Next: , Previous: , Up: actor-lib: A standard library of sorts   [Contents][Index]


6.4 Inbox

The (goblins actor-lib inbox) module provides an inbox actor that serves as a message queue. Messages can be written to and read from the inbox. The inbox can be also be closed to prevent further messages from accumulating.

When a message is read from the inbox it will return the next message if available. If no message is available it will return a promise. If the inbox is stopped it’ll break all pending unfulfilled promises.

Procedure: spawn-inbox

Spawns a new inbox, returning three actors: read, write, and stop actor.

Persistence Environment: inbox-env