Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize repository for use with Octane #83

Closed
lindyhopchris opened this issue May 29, 2021 · 7 comments
Closed

Optimize repository for use with Octane #83

lindyhopchris opened this issue May 29, 2021 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@lindyhopchris
Copy link
Contributor

So that this package works with Laravel Octane, we need to replace any dependency injection of the container, HTTP request and config repository with lazy loading injections. As per these docs:
https://laravel.com/docs/8.x/octane#dependency-injection-and-octane

@lindyhopchris lindyhopchris added the enhancement New feature or request label May 29, 2021
@lindyhopchris
Copy link
Contributor Author

And here's the missing piece that I thought was inevitable that they'd have to introduce... new container singletons that are flushed before handling a new HTTP request or queued job, via the scoped() method on the container:
https://laravel.com/docs/8.x/container#binding-scoped

@isaackearl
Copy link

I'd love to see octane support with this package. has there been any traction on this?

@lindyhopchris
Copy link
Contributor Author

No, haven't had time yet to do this as I've had very little Open Source time recently. If someone had time to help out, this issue might be good for PRs? The first step with this issue is to identify which singletons need to be modified to either scoped() bindings or to follow the pattern suggested in the Octane docs linked above.

@lindyhopchris
Copy link
Contributor Author

I've made these changes, and they will be included in the 2.0 release. I believe they should work with Octane, but as I'm not using Octane it's a bit difficult to tell for sure. If anyone is using Octane and can give the 2.0 release a go when it's tagged, that'll be appreciated!

@lindyhopchris lindyhopchris added this to the 2.x milestone Jan 2, 2022
@plunkettscott
Copy link

I can test this out on 2.0 when tagged. Just @ me.

@lindyhopchris
Copy link
Contributor Author

@plunkettscott are you able to test out before I tag 2.0?

You can install by setting your minimum-stability to dev in composer.json then running:

composer require laravel-json-api/laravel:^2.0 --no-update
composer up laravel-json-api/*

@plunkettscott
Copy link

Looks good. I haven't been able to inspect for memory leaks or anything yet, but if I notice them I'll report them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants