Reactor Functions allow your server-less functions to be invoked following channel lifecycle events (such as channel creation), presence events (such as members entering or leaving) or messages being published. Reactor Functions are offered as part of our Ably Reactor Event service, a service available to all customers of the Ably platform.
Reactor Functions are rate limited and designed for low to medium volumes of updates. If you expect a high volume of events and messages (upwards of 20 per second), then you should consider using our message queues or firehose instead as they are designed to scale without limits.
Generally, customers who want to receive events as they happen, use our message queues or firehose, or alternatively our realtime client libraries and subscribe to events and messages published. However, some customers prefer a server-less architecture and want to have their code invoked when a user publishes a message, attaches to a channel, or enters the presence set on a channel. For example, a developer may want to send a welcome message to someone when they first enter a chat channel. A reactor Function can be used to achieve this.
Reactor Functions are are designed to trigger server-less functions on common platform such as Amazon and Google. If you are looking to trigger execution of code on your own servers over HTTP when a message is published or event occurs, see our Reactor WebHooks.
Ably currently supports three types of data that can be delivered via our Firehose:
- Messages – messages trigger function calls as soon as they are published on a channel
- Presence events – when clients enter, update their data, or leave channels, the presence event triggers a function call
- Channel lifecycle events – when a channel is created (following the first client attaching to this channel) or discarded (when there are no more clients attached to the channel), the lifecycle event triggers a function call
Server-less platform support
We can support the following server-less platforms:
- Amazon Lambda
- Google Cloud Function
- Azure Functions
Reactor Functions for AWS Lambda are currently in public beta. Get in touch if you’d like to join the beta program Reactor Functions for Google Cloud and Azure functions are currently in closed beta. All three are expected to go into general availability at the start of Q4 2017.