-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
joinRealtimeChannel
method with webxdc realtime API
#78
Conversation
joinRealtimeSession
method for managing realtime sessionsjoinRealtimeSession
method for managing realtime sessions
joinRealtimeSession
method for managing realtime sessionsjoinRealtimeChannel
method for managing realtime sessions
joinRealtimeChannel
method for managing realtime sessionsjoinRealtimeChannel
method with webxdc realtime API
src-docs/spec/joinRealtimeSession.md
Outdated
|
||
Start listening on the realtime channel using the specified callback. | ||
The callback receives `Uint8Array` data items that were sent from connected peers. | ||
Calling `setListener` a second time will replace the previous listener. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if the passed value is something other than a function? for instance:
realtimeChannel.setListener()
Will that throw an error, or cause it to stop listening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it should throw an error -- Also "send()" should throw an error if not argument is provided. FWIW in Python the interpreter would do it itself and there is no need to specify that extra. Maybe we can get to make it a general practise in webxdc APIs to throw errors when the minimally specified arguments are not passed in, also for setUpdateListener
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do so
src-docs/spec/joinRealtimeSession.md
Outdated
connected peers but not by peers connecting later. | ||
|
||
Calling `joinRealtimeChannel` a second time without leaving the prior one | ||
will not cause any action and returns a `null` value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better not specify it? Something happens, maybe null
, maybe an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum, I prefer APIs that have defined results so that i don't need to check for any of undefined, null or exception to notice errors.
Co-authored-by: link2xt <link2xt@testrun.org>
Should we merge this @hpk42 I think it is stable now |
alternative to #77 implementing all realtime functiuonality through a single
joinRealtimeChannel
object.