diff --git a/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit b/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit new file mode 100644 index 0000000..8214c27 --- /dev/null +++ b/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit @@ -0,0 +1,32 @@ +package golem:api@1.1.0-rc1; + +interface oplog-processor { + use wasi:clocks/wall-clock@0.2.0.{datetime}; + use golem:rpc/types@0.1.0.{wit-value}; + + use host.{account-id, component-id, oplog-index, worker-id, worker-metadata}; + use oplog.{oplog-entry}; + + record account-info { + account-id: account-id + } + + /// A processor resource is instantiated for each account having activated this oplog processor plugin. + /// There are no guarantees for the number of processors running at the same time, and different entries from the same worker + /// may be sent to different processor instances. + resource processor { + /// Initializes an oplog processor for a given component where the plugin was installed to. + /// The `account-info` parameters contains details of the account the installation belongs to. + /// The `component-id` parameter contains the identifier of the component the plugin was installed to. + /// The `config` parameter contains the configuration parameters for the plugin, as specified in the plugin installation + /// for the component. + constructor(account-info: account-info, component-id: component-id, config: list>); + + /// Called when one of the workers the plugin is activated on has written new entries to its oplog. + /// The `worker-id` parameter identifies the worker. + /// The `metadata` parameter contains the latest metadata of the worker. + /// The `first-entry-index` parameter contains the index of the first entry in the list of `entries`. + /// The `entries` parameteter always contains at least one element. + process: func(worker-id: worker-id, metadata: worker-metadata, first-entry-index: oplog-index, entries: list) -> result<_, string>; + } +}