ChronoTrigger
Make Rails apps that feel alive.
Last updated
Make Rails apps that feel alive.
Last updated
The chrono_trigger
gem is a clock-based event scheduler that runs inside your Rails app. It runs code at specific times and intervals.
Nobody wants to be the first person to arrive at a club, and yet, this is exactly what most app onboarding processes feel like:
After you spend months building something cool, you have to hustle just to get people to check it out. A typical visitor will spend 7-12 seconds evaluating your hard work before deciding if they will engage. You get one chance to recruit your first followers... or else, they will close the tab and forget you exist.
Onboarding success stories like Slack prioritize anticipating what the user will be thinking, feeling and wondering during each moment of their first minutes on the site.
ChronoTrigger is a tool designed to breathe life into otherwise static user interfaces and onboarding experiences.
ChronoTrigger is for developers looking to orchestrate the onboarding experience your app deserves, without the hard sell:
interactive demos, charts and UI elements
automation and wizards that feel personal
placeholder content that changes to help tell a story
a path through features instead of just clicking everything
simulated human responses and exchanges
A natural fit with CableReady and Stimulus
Easy to learn, quick to implement
Plays well with tools such as StimulusReflex and Turbo Drive
Configurable via an optional initializer file
Worker pool provided by the excellent concurrent-ruby library
ChronoTrigger runs on real world time, just like trains. 🚂
Every second, on the second, ChronoTrigger's thread-safe worker pool checks to see if there are new events to run.
Other event scheduling libraries tend to be either cron
wrappers or use timing offsets (think: sleep 1
) from whenever they are called and don't factor in their own timing footprint. In other words, 1000 loops later, more than 1000 seconds have passed. No good! 🙅♂️
You start the ChronoTrigger Clock after your web server, and it runs inside your Rails app process.
ChronoTrigger Events live in app/events
and follow a structure that will be familiar to ActiveJob users.
You can schedule Events from anywhere in your application that it makes sense to do so, such as:
Controller actions and webhook callbacks
ActiveRecord model callbacks
Devise session/registration callbacks
Reflex action methods
ActionCable Connection/Channel subscription callbacks
Github repo and Heroku demo coming soon.