Run asynchronous object controllers from accepted graph jobs
This commit is contained in:
+12
@@ -10,6 +10,8 @@ workspace AsyncObjects id "workspace:async" revision "workspace:async@1" commit
|
||||
private state Content id "async:state:content" on Document : string policy register;
|
||||
private state Summary id "async:state:summary" on Document : record { text: string; basedOn: string; }
|
||||
policy register default { "text": "", "basedOn": "" };
|
||||
private state PendingJob id "async:state:pending-job" on Document : optional<record { operationId: string; }>
|
||||
policy register default null;
|
||||
private edge ProviderLink id "async:provider-link" {
|
||||
atom Document projection provider id "async:provider-projection" exactly-one public-traversal;
|
||||
atom Provider projection documents id "async:documents-projection" many-unique;
|
||||
@@ -18,12 +20,22 @@ workspace AsyncObjects id "workspace:async" revision "workspace:async@1" commit
|
||||
bind content.get to state Content.read;
|
||||
bind summary.get to state Summary.read;
|
||||
bind summary.set to state Summary.write;
|
||||
bind pendingJob.get to state PendingJob.read;
|
||||
bind pendingJob.set to state PendingJob.write;
|
||||
bind recordSummary.call to package ControllerRuntime.finish with {
|
||||
job to state PendingJob;
|
||||
summary to state Summary;
|
||||
};
|
||||
}
|
||||
conform Document as SummaryController id "async:document:controller" {
|
||||
bind refresh.call to package ControllerRuntime.refresh with {
|
||||
document to interface DocumentData;
|
||||
provider to interface Summarizer via edge ProviderLink.provider;
|
||||
};
|
||||
bind processPending.call to package ControllerRuntime.runPending with {
|
||||
document to interface DocumentData;
|
||||
provider to interface Summarizer via edge ProviderLink.provider;
|
||||
};
|
||||
}
|
||||
conform Provider as Summarizer id "async:provider:summarizer" {
|
||||
bind summarize.call to package ProviderRuntime.summarize;
|
||||
|
||||
Reference in New Issue
Block a user