Routemaster Client v0.2.0 Routemaster.Drain.JsonDecoder View Source

Wraps Poison to explicitly decode JSON into Routemaster.Drain.Event structures.

Link to this section Summary

Functions

This function is the only expected interface for the decoder objects

Link to this section Functions

Link to this function decode!(body) View Source
decode!(binary) :: list

This function is the only expected interface for the decoder objects.

The caller expects this to raise exceptions in case of failures.

This decoder is only used to parse JSON payloads received from the bus. The JSON body received from the bus should always be a list, so if it valid JSON but is not a list this function will raise a Routemaster.Drain.JsonDecoder.InvalidPayloadError exception.