You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@milyin regarding the declare_subscriber in session, I was trying to replicate how zenoh Rust allowed either A handler or a callback.
In Zenoh Rust the user can call declare_subscriber
and either follow with a .callback() or a .with() which allows a handler.
I can put this in a options object if needed, but it is the only option that declare_subscriber takes, so i wasn't sure if it made sense to wrap it in an object seeing as it was the only one.
I also debated having something like an object containing
{
callback:...handler:...
}
but the possibility of a user putting both in both a callback and a handler that they can poll seemed confusing from a usage perspective.
With regards to the Async and Promise, i agree it does need to be better aligned and cleaned up.
I've been using the Rust API as a reference, but a number of additional options in the builder pattern for the declare_x functions only exist on AdvancedPubSub which I believe was not planned originally for the Typescript API.
The zenoh-c API takes callbacks as a parameter of function. I think we should follow this approach. I.e. lets keep declare_subscriber as is, but e.g. move callback parameter to declare_queryable parameters from QueryableOptions like it's done in zenoh-c
Adding empty SubscriberOptions are not necessary for now. In zenoh-c it's empty dummy structure. But we need to be sure that it can be easiliy added in the future.
Some functions returns
Promise
, some not. I don't see any system in this.E.g.:
but
Also why for liveliness' Subscriber
callback
is in options, but for session's one - in parameter and there is no options (dummy at this moment)Need to go through ts API and align it. The zenoh-c and zenoh-cpp APIs can be used as a reference
The text was updated successfully, but these errors were encountered: