glock v0.1.0 Glock.Socket View Source

Defines the genserver that starts and manages the underlying gun process. The glock socket is configured to trap exits and monitor the gun connection to the remote server. In the event of failure, glock establishes a new http connection to the server if possible immediately attempts to re-upgrade to a websocket connection.

The __using__/1 macro provides default implementations of the three glock callback functions: c:init_stream/1, c:handle_send/2, and c:handle_receive/2, and marks them as overridable to allow for customization.

Provides functions for sending messages to the glock process for handling and relaying to the remote websocket server both synchronously and asynchronously.