10.6. Communication Channel

Our last piece of the user distributed data structure is a communication channel, which is a consumer channel like those we discussed in Chapter 5. This channel is used to collect all messages sent to the user. When new messages arrive they are appended to the tail of the channel, and as they're displayed on the user's messenger console, they're deleted from the head of the channel.

The channel—like the user's account and friends list—persists in the space as the user logs in and out of the service. If the user happens to log out just as new messages are being appended to the channel, but before they are displayed to the console, the messages aren't lost: The next time the user logs back into the messenger, the unread ...

Get JavaSpaces™ Principles, Patterns, and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.