The best way to send events on Sailhouse is via our language-native SDKs. These wrap around our core HTTP APIs, and include some useful functionality such as streaming and batching.

Publishing events

Sending, or publishing, and event is the first step in communicating with your application.

await client.publish("some-topic", {
    some: "property",
});

As mentioned above, an event must be sent to a topic. This directs your event to downstream subscribers, and acts as a “bucket” that your different types of events can live in. To read more fun things about topics, head over to their concepts section.

Once an event is in a topic, it is sent to all the subscriptions of a topic. Say you have a user-created event, which you send when someone signs up to your application. You may have some subscriptions like send-welcome-email and check-spam-score. These subscriptions will both get a copy of the event, where it will sit until acknowledged in future.

Scheduling events

You can schedule an event to be sent at a future time for a topic. This can be any time in the future, and the event will not be sent to subscribers until that date.

The scheduled event will be sent to all subscribers present when it is scheduled for. If you add a subscriber inbetween after it has been sent, but before the scheduled time, it will be sent to that subscription.

client.publish('reminder-queue', {
    user_id: '123'
}, {
    date: new Date() // some future date
})