SerializingMailbox

class SerializingMailbox(serializer: SerialFormat = Json) : Mailbox<Int>

A Mailbox that serializes messages using the provided serializer. It can be used to test serialization and deserialization of messages.

Parameters

serializer

The serializer to use for serialization and deserialization.

Constructors

Link copied to clipboard
constructor(serializer: SerialFormat = Json)

Properties

Link copied to clipboard
open override val inMemory: Boolean = false
Link copied to clipboard

The mailbox that stores the messages. The key is the ID of the sender, and the value is the message.

Functions

Link copied to clipboard
open override fun currentInbound(): NeighborsData<Int>
Link copied to clipboard
open override fun deliverableFor(outboundMessage: OutboundEnvelope<Int>)
Link copied to clipboard
open override fun deliverableReceived(message: Message<Int, *>)
Link copied to clipboard
fun receiveAndDeserialize(serialized: String)

Deserializes the given serialized message and delivers it to the mailbox. The message must be serialized using the provided serializer.

Link copied to clipboard

Serializes the message with the given id and returns it as a string.

Link copied to clipboard
open override fun toString(): String