Event streams

PHOTO EMBED

Wed Jun 21 2023 12:40:37 GMT+0000 (Coordinated Universal Time)

Saved by @AndraAbly #javascript

let postEvents = new models.EventStream<PostEvent>({
	name: 'post',
	channel: 'posts',
	filter: 'id == `123`',
});

let commentEvents = new models.EventStream<CommentEvent>({
	name: 'comment',
	channel: 'comments',
	filter: 'post_id == `123`',
	orderingKey: 'id',
});
content_copyCOPY

Events are delivered to the model through event streams which is an abstraction layer over a channel. It takes on the channel management responsibilities and offers additional event guarantees for the client.