-
Notifications
You must be signed in to change notification settings - Fork 0
Typical Use Case
A typical use case for the thing broker looks something like this:
You will create a thing representing a mobile phone, (or a <div> on the mobile phone browser page), and another thing representing a screen application. The phone may also be a situated sensor, etc..
One application (a phone browser, native or hybrid app for example) will send events to the phone thing on the broker. These events should get relayed to the screen thing, and retrieved by the (server or browser) application listening for events on the screen thing. Similarly, the screen application may send events to the screen thing, which are then relayed to the phone things. The phone applications will receive these, and do the 'right thing'. To broadcast to all phones, you send events to the screen. When users walk up to the screen with their phones, they are discovered (somehow) then connected to the screen by establishing follow/following links.
To support discovery the thingbroker needs a way for apps to query and get notified when relevant things are ‘nearby’, or apps need to be able to establish links using an out of band discovery mechanism (e.g. QR code scanning). Then an application can set up following/follower relationships.
The screen thing should ‘follow’ the phone things, receiving events from all of them. Similarly, the phone things should all follow the screen thing, receiving events from the screen. In this way, the phones are publishers of events to the screen, and the screen is an event publisher to the phones.
Typically, applications listening to a thing will only be interested in events from the things they follow, not events sent to the thing itself, since they are typically the ones sending them (publisher).
This highlights the need for the following:
- Need for API to follow/unfollow things. This seems to be mostly there, but it is implicit.
- Ability to get events from only the followed things if desired.
- Ability to discover things, applications should be able to query and/or get notified when things they are interested in are available.
This will allow things to interact differently depending on their follow/following relationships. When a phone moves to a different screen, the thingbroker follow/following relationships need only be set up accordingly. Screen and phone applications will continue to publish and subscribe to the same things -- only follow(er) links need to change.