Files
language-reader/events.qx
T

22 lines
1.1 KiB
Plaintext

fragment {
import interface EventStream;
import interface EventHandler;
import interface EventSubscription;
import interface EventStreamRecord;
import interface EventSubscriptionRecord;
conform<value Payload> EventStreamRecord<Payload> as EventStream<Payload> id "events:standard-stream" {
private state Entries id "events:entries" on Self : Payload policy journal {"maxEntries":128,"maxBytes":1048576,"maxPublicationBytes":262144,"maxProtectedSubscriptions":32};
bind publish.call to journal Entries.publish;
bind head.get to journal Entries.head;
bind readPage.call to journal Entries.readPage;
}
conform<value Payload,value Parameters> EventSubscriptionRecord<Payload,Parameters> as EventSubscription<Payload,Parameters> id "events:standard-subscription" {
private state Delivery id "events:delivery" on Self : Parameters policy subscription(Payload);
bind attach.call to subscription Delivery.attach;
bind status.get to subscription Delivery.status;
bind pause.call to subscription Delivery.pause;
bind resume.call to subscription Delivery.resume;
bind retire.call to subscription Delivery.retire;
}
}