Recently I was hastily building an API for a client and I wanted to run some tests against it. I've written before about using Runscope for API testing, but this was against a local dev platform (inside a VM, not directly on my laptop) rather than a public API. The same problem arises if you want to access a local site or API from elsewhere or from a mobile device. In all these scenarios, ngrok is your friend. Continue reading
I have just introduced Beanstalkd into my current PHP project; it was super-easy so I thought I'd share some examples and my thoughts on how a job queue fits in with a PHP web application.
I have an API backend and a web frontend on this project (there may be apps later. It's a startup, there could be anything later). Both front and back ends are PHP Slim Framework applications, and there's a sort of JSON-RPC going on in between the two.
The job queue will handle a few things we don't want to do in real time on the application, such as:
- updating counts of things like comments; when a comment is made, a job gets created and we can return to the user. At some point the job will get processed updating the counts of how many comments are on that thing, how many comments the user made, adding to a news feed of activities ... you get the idea. Continue reading