19 lines
1.2 KiB
Plaintext
19 lines
1.2 KiB
Plaintext
import interface EventStream;
|
|||
|
|
import interface EventHandler;
|
||
|
|
type StartPosition = variant id "org.quixos.events:start@1" {
|
||
|
|
future id "events:start:future" : unit;
|
||
|
|
retained id "events:start:retained" : unit;
|
||
|
|
afterCursor id "events:start:after" : string;
|
||
|
|
};
|
||
|
|
interface EventSubscription<value Payload,value Parameters> id "interface:org.quixos.events:subscription" revision "interface:org.quixos.events:subscription@1" {
|
||
|
|
operation attach id "events:attach" : record {source:interface-ref<EventStream<Payload>>;handler:interface-ref<EventHandler<Payload,Parameters>>;parameters:Parameters;start:StartPosition;} -> unit {
|
||
|
|
call id "events:attach:call" execution transaction;
|
||
|
|
}
|
||
|
|
queryable value status id "events:status" : record {status:string;generation:uint64;cursor:uint64;failure:optional<record {publication:string;code:string;message:string;}>;} {
|
||
|
|
get id "events:status:get" execution snapshot;
|
||
|
|
}
|
||
|
|
operation pause id "events:pause" : unit -> unit {call id "events:pause:call" execution transaction;}
|
||
|
|
operation resume id "events:resume" : unit -> unit {call id "events:resume:call" execution transaction;}
|
||
|
|
operation retire id "events:retire" : unit -> unit {call id "events:retire:call" execution transaction;}
|
||
|
|
}
|