-
Notifications
You must be signed in to change notification settings - Fork 28
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
Clarify multiple requests for subscription/observation #346
Comments
We need to add steps to algorithms to clarify this.
Option 2
I think Option 1 is manageable and cleaner. We need to update the unsubscribe steps as well, to map the API behavior to protocol. Some bindings might allow multiple subscriptions with different client side id, some will just allow one kind of subscription since the notifications are the same. Even in the latter case the API might want to support multiple callback functions (one per client-side subscription). |
Question: Is this really a question we as the Scripting API task-force should answer or should that be defined in the TD spec? |
I think is up to us, since is something closely related to how an application would use the subscription/observation APIs.
What about Option 3 instead of Option 2?:
I think it is safer than silently changing subscription callbacks 🤔 And about Option 1, we should decide if it creates a new network subscription or just a runtime subscription (i.e., re-use the network subscription but multiplexing events to different functions). Notice that in the case of runtime subscription we should consider the list of active subscriptions in the stop method and close the network subscription only after all runtime subscriptions are stopped. |
Scripting API Call 2021-11-15 @relu91 recalls that re-working the API was based on the assumption to support to multiple subscriptions (we fail to do so). Other possible Solutions
|
Subscriptions are per ConsumedThing object (for each interaction that can be subscribed to). New subscription should either return error, or replace an old subscription. |
resolved by #356 |
@danielpeintner I'm closing this, feel free to re-open if anything. |
With the latest changes, we introduced a new interface for handling
subscriptions
/observe changing
on aConsumerThing
. However, for the implementer is not clear how the runtime should act when an application is issuing multiple subscriptions/obersevation for the same affordance.In principle thanks to the new control objection
Subscription
it's possible to handle multiple functions registered as listeners for an affordance. However, this possibility is never mentioned (or at least I couldn't find it) in the document leaving open to interpretation how the process should look like. Furthermore, the document explicitly says that when thestop
method is called on aSubscription
this request should be immediately be sent to theprotocol
layer. As I read this, a vague hint to the fact that in practice you can have just one single Subscription object, because as soon as you stop it you have to cancel the subscription at the protocol level (e.g., closing the connection, unsubscribe request etc. ).Actions points:
The text was updated successfully, but these errors were encountered: