Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
ChronoTrigger is designed to work with Rails 5.2 and beyond. It has minimal gem dependencies and no infrastructure dependencies.
In the app/events
folder, we will create an ApplicationEvent
class for our Event
classes to inherit from:
While you can use ChronoTrigger to run any code, it has been designed to work with . Including CableReady::Broadcaster
makes the cable_ready
method available to all of your Event
classes.
If you plan to use CableReady to send rendered HTML, you might wish to delegate render
to ApplicationController
.
Finally, you need to start the Clock
! The best place to do this is after Puma starts up:
Today, it's possible to configure the resolution of the timer, but the 100ms default is likely fine. There will be additional options added in the future: