BaileysEx.Connection.Coordinator (baileys_ex v0.1.0-alpha.9)

Copy Markdown View Source

Runtime wrapper around the raw connection socket.

This process owns wrapper concerns that Baileys keeps outside makeSocket: initial connect/reconnect policy, init queries, dirty-bit handling, and persisting emitted credential updates.

Summary

Functions

Returns a specification to start this module under a supervisor.

Send a message through the coordinator-owned runtime state.

Send a status message through the coordinator-owned runtime state.

Start the coordinator process. Accepts a keyword list containing :config, :event_emitter, :store, :signal_store, :supervisor, and :task_supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

send_message(server, jid, content, opts \\ [])

@spec send_message(GenServer.server(), BaileysEx.JID.t(), map() | struct(), keyword()) ::
  {:ok, map()} | {:error, term()}

Send a message through the coordinator-owned runtime state.

send_status(server, content, opts \\ [])

@spec send_status(GenServer.server(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}

Send a status message through the coordinator-owned runtime state.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Start the coordinator process. Accepts a keyword list containing :config, :event_emitter, :store, :signal_store, :supervisor, and :task_supervisor.