Sometimes it is desirable to execute actions in the background and periodic intervals. Building on from last week’s post, I wanted to spotlight a new feature, which uses the asynchronous event queue, to allow you to do this – the periodic execution (cron) service.
After completing the configuration step for enabling the Asynchronous Event Queue, you can then run the Known console periodic execution service:
Once running, this service will periodically trigger an event to which code can listen to. Available events are
While I’ve not really had a chance to talk about it recently, owing to being rather busy, there has been a lot of work done in Known core recently.
Known uses event queues to dispatch things like Webmention pings. By default, this dispatching is synchronous. However, an advanced feature that was recently added, was the ability to enqueue events and have them dispatched later in an asynchronous fashion, enabling faster page loading.
As mentioned above, by default Known uses a synchronous event queue. To use something the asynchronous queue, add the following line to your
event_queue = 'AsynchronousQueue'
Next, you need to run the Known event queue dispatching service using the Known console tool:
Note: if you’re using per-domain configuration you’ll need to set an environment variable in order for everything to work as expected:
One of the features I’d really like to have in Known, is the ability to schedule posts for a later date.
Sometimes I do this via my post by email plugin combined with an email scheduling tool, and at some point I’ll actually get around to sending a pull request to schedule posts natively.
In the meantime, I wrote a quick plugin which makes use of the Buffer service to create a post schedule for your a number of social networking accounts.
When installed and configured, this plugin will give you a new “buffer” syndication channel which will act like a meta channel – posting to multiple social networking accounts configured according to your buffer schedule.
Hope this is useful to some of you!
» Visit the project on Github...