Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, but how do you handle the result? You will need a closure to store the context you had when you made the function call. That is async.


The queue is given the command. The command has the functions I want to run, including the context and what I want done with the result. It can be a closure right up to a full class.

Using a framework like Laravel I can even "chain" queued commands - so CommandA will queued, then call CommandB when it is done etc.

I've never run into a situation that wasnt easily solved by this.


OK so what environment is the function being executed in? That environment is outside of PHP. Now when it comes time to do the callback, is the PHP thread still running, or not?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: