-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Coming from this issue in node-wot.
Use case: A reverse proxy implementation consumes a physical Thing in a local network and reexposes it as a new virtual ExposedThing to another network. A consumer of the virtual ExposedThing subscribes to an event. The issue is that there is no way to detect and handle a new subscription so that the proxy can subscribe to the event in the physical Thing. A non-optimal solution is to subscribe to the events of the physical Thing in the beginning (without any subscription) and reemit them when the events come to the proxy.
Proposal: Create two new methods in the ExposedThing interface, one to handle the subscription and one to handle unsubscription. These could be similar to setPropertyReadHandler. Example:
- setEventSubscribeHandler(eventName, ? subscriptionPayload, ? subscriptionCount): This could also solve the handling of subscription payloads. A subscription count would be interesting if the implementation wants to limit the number of subscriptions due to resource constraints.
- setEventUnsubscribeHandler(eventName, ? cancellationPayload, ? subscriptionCount): Similar to the above
Metadata
Metadata
Assignees
Labels
No labels