Elixir MOM v0.5.3 MOM.RPC.Endpoint.JSON

Summary

Functions

Parses a line from the client

Connects an RPC to do JSON communications

Functions

parse_line(client, line)

Parses a line from the client

This is called from the user of this endpoint, not at MOM, for example from the WebSockets implementation.

Returns:

  • :ok — parsed and in processing
  • {:error, :bad_protocol} — Invalid message, maybe not json, maybe not proper fields.
start_link(rpc_in, rpc_out, options \\ [])

Connects an RPC to do JSON communications

  • rpc_in is the RPC channel that will receive calls and events
  • rpc_out is the RPC channel on which this endpoint will perform the calls and receive the responses.
  • options are the options:

    • writef : f(str) to write to the remote side
stop(json, reason)