MessageEnd
Description
Event to mark the end of a message in an event stream.
It can also hold the high-level representation for the footer of the message in its tail property.
The content of tail can vary according to the protocol being used. See For each protocol.
Constructor
new MessageEnd(tail?, payload?)
Creates an instance of MessageEnd.
Properties
payloadValue representation of the message body after decoding.
Protocol-dependent message footer.
Type of the event.
Example
This example could be done more concisely with a Message object.
pipy().listen(8080).demuxHTTP().to($=>$.replaceMessage([// This can also be done with a single Message object.new MessageStart({status: 200,statusText: 'OK',headers: {'content-type': 'text/plain'}}),new Data('Hello!\n'),new MessageEnd,]))