Documentation ¶
Overview ¶
Package mailbox provides asynchronous message delivery to players. A mailbox is registered with the Player's UID using the Add function which returns a channel for receiving messages. Messages can be sent using the Send function with the UID of the recipient player. When the mailbox is no longer required Delete should be called to close the channel and remove the mailbox.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add a mailbox for the given UID and return a channel for receiving mailbox messages.
func Delete ¶
func Delete(uid string)
Delete removes the mailbox for the given UID. Any messages send to a deleted mailbox will be discarded. Outstanding messages not retrieved yet will still be delivered.
func Exists ¶
Exists returns true if a mailbox exists for the UID, otherwise false.
func Send ¶
Send writes the given message to the mailbox for the given UID. Priority messages are always sent. Non-priority messages are sent if they are not a repeat of the last non-priority message sent - this helps cut down on message spamming. If mailbox is full then remove + drop oldest message and try adding message again.
Types ¶
This section is empty.