Core Design Streams Rpc - Gadreel/dcraft GitHub Wiki
Data In or No In Data Out or No Out
just like CMS1/2
Only once per session, then sticks with the User in Session until session dies or until logout is called.
No need for verify.
Creds can be included with each request, but only acknowledged once if Session is used
Data In Stream Out
<Op Name="Lookup">
<Request Type="zName" Required="True" />
<ResponseStream Type="zChefRating" />
</Op>
Data In Stream In Data Out Stream Out
<Op Name="TranslateSummarize">
<Request Type="zName" Required="True" />
<RequestStream Type="zChefRating" />
<Response Type="zScore" />
<ResponseStream Type="zChefRating" />
</Op>
Stream In Stream Out
<Op Name="Convert">
<RequestStream Type="zChefRating" />
<ResponseStream Type="zChefRating" />
</Op>
Data In Data Out
<Op Name="Summarize">
<Request Type="zName" Required="True" />
<Response Type="zScore" />
</Op>
Stream In Data Out
<Op Name="ReviewSummarize">
<RequestStream Type="zChefRating" />
<Response Type="zScore" />
</Op>
Also no Request or Response need be present at all.
Careful not to call services with large result sets.
{ "Data": [start data], "Stream": [stream in data] }
{ "Data": [final data], "Stream": [stream out data] }
Three Steps
- Call Session Stream Start with the start data and service name, returns a stream id
- service is not called yet, we allocate a stream id and queue up the data request
- PUT data to stream id (PUT /dc-stream/NNNN) unless empty then GET
- when the stream request comes find the queued request and send it with the start data and the streams attached
- process response data as stream, if any
- Call Session Stream End with the stream id, returns final data
- final data will be queued with the stream id and returned
like above but multiplexed?
// use the result to be sure the message sent static public boolean call(String service, String feature, String op, Struct data, OperationOutcomeStruct callback)
// consume a stream, but don't supply a stream
// use the result to be sure the message sent
static public boolean call(String service, String feature, String op, Struct data, IServiceStreamDest<?> consumer) throws OperatingContextException {
// consume a stream and supply a stream
// use the result to be sure the message sent
static public boolean call(String service, String feature, String op, Struct data, IStreamUp supplier, IServiceStreamDest<?> consumer) throws OperatingContextException {
// do not consume a stream, but do supply a stream
// use the result to be sure the message sent
static public boolean call(String service, String feature, String op, Struct data, IStreamUp supplier, OperationOutcomeStruct callback)