sendBlob method

Future sendBlob (String destination, Stream<List<int>> message, { Map<String, String> headers })

Sends a message read from a given Stream.

  • It saves the memory use since the message is piping from Stream
  • to the network directly.
  • Notes
    • Though it is typed List, it is actually an array of bytes (i.e.,
  • only the lowest 8 bits are meaningful, aka, octets).
    • Since STOMP is text-based messaging protocol, the message being written can't
  • contain the NULL octet (i.e., value 0). For example, you can encode as base64.
    • Unlike other send methods, sendBlob won't set the content-length header.
  • If you know the length in advance, you can pass it into headers.
    • The return Future instance indicated when the message has been sent.
  • It is important to note than before it completes, you can send other
  • messages. Otherwise, an exception is thrown.

Implementation

Future sendBlob(String destination, Stream<List<int>> message,
    {Map<String, String> headers});