The sessions that the screens open on demand (design.md, "Connection lifecycle", decision D11): the volume of an idle card, the settings sheet.
More...
|
|
| FCastReceiverLinks (Factory factory, ScheduledExecutorService timers) |
| |
| | FCastReceiverLinks (Factory factory, ScheduledExecutorService timers, long closeAfterMillis) |
| |
| | FCastReceiverLinks (Factory factory, ScheduledExecutorService timers, long closeAfterMillis, java.util.function.Supplier< ScheduledExecutorService > sessionExecutors) |
| |
| synchronized Link | open (FCastEndpoint endpoint) |
| | Opens a link to the receiver: its session is made if there is none (no connection yet: the first command connects).
|
| |
|
synchronized boolean | isOpen (FCastEndpoint endpoint) |
| | True if a session of this receiver is open here (for the text of an idle card: no connection means no state).
|
| |
|
synchronized FCastSession | peek (FCastEndpoint endpoint) |
| | The session of the receiver if one is open here, else null.
|
| |
|
synchronized void | handOverToPlayer (FCastEndpoint endpoint) |
| | A player takes the receiver: the session of the screens closes at once (never two connections to one receiver).
|
| |
|
synchronized void | closeAll () |
| | Closes everything (the app exits).
|
| |
The sessions that the screens open on demand (design.md, "Connection lifecycle", decision D11): the volume of an idle card, the settings sheet.
An idle card has no connection; whoever needs one opens a link, uses its session, and closes the link, and the session is closed {@value CLOSE_AFTER_MILLIS} ms after the last link of the receiver was closed (a short grace so that a second tap or the sheet that opens next uses the same connection). Each session has its own thread, so a receiver that does not answer blocks only itself. A receiver has at most one session here, at most {@value MAX_SESSIONS} receivers are open at once (the global cap of the security rules), and a receiver that a player plays to is left to the player (handOverToPlayer: the player has its own session and there is never a second connection to the same receiver). Thread safe; the sessions run on the executor that was given.