5.7. Bounded Channels

Our assumption in the channel examples has been that the space itself can store as much data in a channel as we can throw at it. Obviously that approach might be infeasible, or at least unfair, to other users of the space. In many cases, a better approach is to place an upper bound on the number of messages a channel can hold and have writers obey those bounds. For instance, in our pager example, the pager service could place a limit on the number of messages a pager channel can hold.

Before adding bounded channels to our pager, let's step back and get a clearer picture of the general problem. We can view our channels as conduits from producers of information to consumers (or readers) of information. Producers need to add ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.