From 9678fd33e02fa1ad1c96d50667cc43e193f119d0 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Fri, 29 Nov 2024 09:39:34 -0500 Subject: [PATCH 1/2] Initial version of the oplog-processor interface --- .../golem-1.1/golem-oplog-processor-1.1.wit | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 wit/deps/golem-1.1/golem-oplog-processor-1.1.wit 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..748dc81 --- /dev/null +++ b/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit @@ -0,0 +1,33 @@ +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. + /// As workers can dynamically turn on/off the plugin, the list of entries received may not be a continous range. + 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>; + } +} From 4ac1adc9c6c6e165b0832d9becc8488e6016b964 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Fri, 29 Nov 2024 10:11:15 -0500 Subject: [PATCH 2/2] Removed comment --- wit/deps/golem-1.1/golem-oplog-processor-1.1.wit | 1 - 1 file changed, 1 deletion(-) 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 index 748dc81..8214c27 100644 --- a/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit +++ b/wit/deps/golem-1.1/golem-oplog-processor-1.1.wit @@ -14,7 +14,6 @@ interface oplog-processor { /// 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. - /// As workers can dynamically turn on/off the plugin, the list of entries received may not be a continous range. 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.