Sexy.TDL.Handler (Sexy v0.10.2)

Copy Markdown View Source

GenServer that deserializes TDLib JSON into Elixir structs and forwards them to the app.

Receives raw JSON strings from Sexy.TDL.Backend, decodes them, and recursively converts nested @type objects into the corresponding Sexy.TDL.Object.* structs.

Started automatically by Sexy.TDL.Riser — not called directly.

Event types

The handler forwards deserialized objects to app_pid as {:recv, struct} (e.g. %Sexy.TDL.Object.UpdateNewMessage{}). System and proxy events ({:system_event, type, details}, {:proxy_event, text}) are sent to app_pid directly by Sexy.TDL.Backend.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(session)

Callback implementation for GenServer.init/1.

start_link(session_name)