Run asynchronous object controllers from accepted graph jobs
This commit is contained in:
@@ -8,4 +8,15 @@ package ControllerRuntime id "async:controller-runtime" revision "async:controll
|
|||||||
interface document id "async:controller:document" : DocumentData using [content.get, summary.set];
|
interface document id "async:controller:document" : DocumentData using [content.get, summary.set];
|
||||||
interface provider id "async:controller:provider" : Summarizer using [summarize.call];
|
interface provider id "async:controller:provider" : Summarizer using [summarize.call];
|
||||||
};
|
};
|
||||||
|
operation finish id "async:controller:finish"
|
||||||
|
: record { operationId: string; summary: record { text: string; basedOn: string; }; } -> unit
|
||||||
|
mode call execution transaction targets [server] receiver atom Document requires {
|
||||||
|
state job id "async:finish:job" : optional<record { operationId: string; }> [read, write];
|
||||||
|
state summary id "async:finish:summary" : record { text: string; basedOn: string; } [write];
|
||||||
|
};
|
||||||
|
operation runPending id "async:controller:run-pending" : optional<record { operationId: string; }> -> unit
|
||||||
|
mode call execution remote receiver atom Document requires {
|
||||||
|
interface document id "async:pending:document" : DocumentData using [content.get, recordSummary.call];
|
||||||
|
interface provider id "async:pending:provider" : Summarizer using [summarize.call];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -7,4 +7,11 @@ interface DocumentData id "async:document-data" revision "async:document-data@1"
|
|||||||
get id "async:summary:get" execution snapshot targets [browser, server];
|
get id "async:summary:get" execution snapshot targets [browser, server];
|
||||||
set id "async:summary:set" execution transaction targets [browser, server];
|
set id "async:summary:set" execution transaction targets [browser, server];
|
||||||
}
|
}
|
||||||
|
queryable value pendingJob id "async:pending-job" : optional<record { operationId: string; }> {
|
||||||
|
get id "async:pending-job:get" execution snapshot targets [server];
|
||||||
|
set id "async:pending-job:set" execution transaction targets [server];
|
||||||
|
}
|
||||||
|
operation recordSummary id "async:record-summary" : record { operationId: string; summary: Summary; } -> unit {
|
||||||
|
call id "async:record-summary:call" execution transaction targets [server];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,7 @@ interface SummaryController id "async:controller" revision "async:controller@1"
|
|||||||
operation refresh id "async:refresh" : record { operationId: string; } -> string {
|
operation refresh id "async:refresh" : record { operationId: string; } -> string {
|
||||||
call id "async:refresh:call" execution remote;
|
call id "async:refresh:call" execution remote;
|
||||||
}
|
}
|
||||||
|
operation processPending id "async:process-pending" : optional<record { operationId: string; }> -> unit {
|
||||||
|
call id "async:process-pending:call" execution remote;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+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 Content id "async:state:content" on Document : string policy register;
|
||||||
private state Summary id "async:state:summary" on Document : record { text: string; basedOn: string; }
|
private state Summary id "async:state:summary" on Document : record { text: string; basedOn: string; }
|
||||||
policy register default { "text": "", "basedOn": "" };
|
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" {
|
private edge ProviderLink id "async:provider-link" {
|
||||||
atom Document projection provider id "async:provider-projection" exactly-one public-traversal;
|
atom Document projection provider id "async:provider-projection" exactly-one public-traversal;
|
||||||
atom Provider projection documents id "async:documents-projection" many-unique;
|
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 content.get to state Content.read;
|
||||||
bind summary.get to state Summary.read;
|
bind summary.get to state Summary.read;
|
||||||
bind summary.set to state Summary.write;
|
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" {
|
conform Document as SummaryController id "async:document:controller" {
|
||||||
bind refresh.call to package ControllerRuntime.refresh with {
|
bind refresh.call to package ControllerRuntime.refresh with {
|
||||||
document to interface DocumentData;
|
document to interface DocumentData;
|
||||||
provider to interface Summarizer via edge ProviderLink.provider;
|
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" {
|
conform Provider as Summarizer id "async:provider:summarizer" {
|
||||||
bind summarize.call to package ProviderRuntime.summarize;
|
bind summarize.call to package ProviderRuntime.summarize;
|
||||||
|
|||||||
Reference in New Issue
Block a user