The client should never even check if a response is given.
I'd suggest even the "exception" of "Parse error" and "Invalid Request",
should be omitted. Especially "Invalid Request" is awkward for me in
this place since "Notifications" aren't requests by definition, "Parse
error" should be a debug-mode facility implemented by server.
Advantage is a cristal clear distinction with regular call :
notification is for non-critical/disposable/frivolous data/ping
streams : "just in case it gets through", if you COULD/SHOULD/MUST
process a response use a regular call.
Any comments on this one ?
> A second aspect: Notifications are one variant. They require one or
> zero reply. What about having multiple replies? Has this been
> discussed yet?
Multi-call has been evoked with possible id-matched multi-response,
nothing GRAS yet.
Lo.
[Notifications]
> The client should never even check if a response is given.
correct.
> I'd suggest even the "exception" of "Parse error" and "Invalid Request",
> should be omitted.
for clarification:
- syntactically correct Notifications *never* get a response.
- if you meant to send a Notification, but send something which is
not syntactically correct, you may get an error-response.
that's what "Parse error" and "Invalid Request" are for: invalid
json/jsonrpc.
so if you meant so send a notification, but send a syntactically
invalid jsonrpc-object, you may get "Parse error" or "Invalid Request"
as response. that's all.
of course I could remove these sentences from the specification if it
is too confusing. but that wouldn't change *anything* in the specified
behaviour.
> Especially "Invalid Request" is awkward for me in
> this place since "Notifications" aren't requests by definition,
they are.
A Notification is a special kind of request.
(see section "Notification" in the proposal)
> "Parse
> error" should be a debug-mode facility implemented by server.
no. please look into the json-rpc proposal, section "Error Object".
there you'll find what "Parse error" is for.
> Advantage is a cristal clear distinction with regular call :
> notification is for non-critical/disposable/frivolous data/ping
> streams : "just in case it gets through", if you COULD/SHOULD/MUST
> process a response use a regular call.
yes, that's how it is currently specified in the proposal.
regards,
Roland
> I understand the concept of the notification,
> but I do not see an advantage in having the client crying "protocol
> error" should the server chose to reply to a notification.
there are 2 kinds of requests:
- requests with a response
- requests without a response (called Notification)
a "request with maybe a response", which you suggest here, doesn't make
much sense in my opinion. how should the client handle this? it wouldn't
know if it should wait for a response or not...
> What about having multiple replies? Has this been
> discussed yet?
no, not directly. the proposal specifies a (synchronous) server-client-
architecture, where the client sends a request and gets an answer.
if you want an asynchronous architecture, or a peer-to-peer-archtecture,
you can simply use both a server and client on both sides.
regards,
Roland
Ok. But then I would state this in a proper chapter, not under "notifications".
> so if you meant so send a notification, but send a syntactically
> invalid jsonrpc-object, you may get "Parse error" or "Invalid Request"
> as response. that's all.
I would not even see that response, save in a packet sniffer ;-)
Cheers
CC.
"Parse error" and "Invalid Request" are expained in the "Error object"
section. under "notification" there's only a note, which I should probably
remove because it causes too much confusion...
regards,
Roland
Ok..
> > "Parse
> > error" should be a debug-mode facility implemented by server.
> no. please look into the json-rpc proposal, section "Error Object".
> there you'll find what "Parse error" is for.
You are right too.
> under "notification" there's only a note, which I should probably
> remove because it causes too much confusion...
It looks you are right as well..
Lo.