Replies: 7 comments 7 replies
-
just one quick note
I think I've enabled it #464 .. not sure, but it should work to start new discussions |
Beta Was this translation helpful? Give feedback.
-
Hmmm... Reading this actually makes me more convinced that this indeed is all application (or library) specific signalling and leads me to believe that this should not be specified on WAMP level after all. Both sides need to have a mutual understanding what's going on there. Also, as how WAMP progressive calls is currently defined, you can specify even another application (or library) on top of this progressive calls which have different requirements and signalling. All that signalling doesn't have any effect on WAMP level... At least, I think it shouldn't, so to keep the progressive call feature more generic. That makes me feel it can be seen as a protocol that can be defined as an extra layer on top of WAMP. Instead of putting all those options in the WAMP specific options dict, couldn't you define or specify those options to be in the application specific kwargs field for this specific streaming protocol? Or do you have another reason to define all that in the WAMP options dict? Also I was thinking, maybe add an application specific section in the WAMP options dict? Like X_stuff headers in http, but then as just one application specific multipurpose node in options dict. Or is the kwargs dict enough already? |
Beta Was this translation helpful? Give feedback.
-
I do like the idea for this application/use case btw. I just think WAMP features should not aim for a specific use case, but should stay generic to support other use cases as well. |
Beta Was this translation helpful? Give feedback.
-
yes, I agree with @Jopie64, this is application specific and shouldn't be defined in the WAMP protocol itself, but simply proprietary to the application. |
Beta Was this translation helpful? Give feedback.
-
I don't want my CppWAMP client library (which is not application specific) to clobber the kwargs payload and remove/hinder the possibility of the user making use of the kwargs for their own purpose. Anyway, I can make it work without those extra WAMP options, it's just they would have been "nice to have". |
Beta Was this translation helpful? Give feedback.
-
The kwargs dict is intended for the user payload. A general-purpose WAMP client library cannot add items to the kwargs dict without possibly breaking user apps. |
Beta Was this translation helpful? Give feedback.
-
Quick note (as i'm afk): |
Beta Was this translation helpful? Give feedback.
-
Here is a collection of notes from implementing a streaming API in CppWAMP via the Progressive Call Results/Invocations feature. I'm posting this in the hopes that other implementations would implement a compatible streaming API in their libraries.
CALL
message. Note that I don't like to use term "signal" in this context (especially in code), because I immediately think of POSIX signals when I see that term.CALL.Options.progress
CALL.Options.receive_progress
CALL
CountRESULT
Countfalse
false
false
true
true
false
true
true
* Note that when both progressive results and invocations are disabled, this decays into a "simple" remote procedure call with a single invocation and a single result.
INVOCATION
message. It deduces the desired streaming mode via theINVOCATION.Details.progress
andINVOCATION.Details.receive_progress
options.callee_to_caller
orbidirectional
, a callee may explicitly accept the invitation by sending an RSVP via an initial progressiveYIELD
. Otherwise, the invitation is assumed as accepted if the callee does not return anERROR
.CALL
andYIELD
options for this purpose.ERROR
message.caller_to_callee
orbidirectional
, after sending an invitation, the caller may send chunks to the callee via progressiveCALL
messages. The stream is closed from the caller's perspective upon sending a final chunk withCALL.Options.progress=false
.callee_to_caller
orbidirectional
, the callee may send intermediary chunks to the caller via progressiveYIELD
messages. The stream is closed from the callee's perspective upon sending a final chunk withYIELD.Details.progress=false
.ERROR
message to close the stream and report back an error condition.CANCEL
message if it needs to close the stream before receiving the final chunk from the callee.bidirectional
mode, a caller can communicate its desire to end the stream gracefully (withoutCANCEL
) via chunk payload arguments. It is up to the application to define the payload schema which allows this intent to be communicated. NOTE: The WAMP protocol could help here by defining aCALL
option for this purpose. This would allow client implementations to perform this "graceful closing" behavior.ERROR
(except for cancellation with thekillnowait
mode, where the callee is not required to yield anERROR
.The above allows for interoperability with client implementations that do not "understand" the streaming concept. The above streaming idea can be done with the existing progressive results/invocations features, but adding the following to the WAMP protocol would ease implementation:
CALL.Options.is_invitation|bool
as a hint for the callee to interpret the first progressive invocation as a stream invitation (i.e. stream signal).CALL.Options.expects_rsvp|bool
as a directive for the callee send an RSVP if it accepts the streaming request.CALL.Options.stop|bool
to communicate the caller's desire to end the stream gracefully inbidirectional
mode.YIELD.Details.is_rsvp
as a hint for the caller to interpret the first progressive result as an RSVP to the invitation.I will add sequence diagrams later for each streaming mode, including the invitation/RSVP exchanges. I will also add a suggested streaming API in pseudocode.
Beta Was this translation helpful? Give feedback.
All reactions