package polymarket
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Module Websocket.ConnectionSource
WebSocket connection management with TLS and reconnection support.
Uses tls-eio for pure-OCaml TLS, avoiding OpenSSL dependencies.
Types
Connection state
Source
type config = {host : string;port : int;resource : string;initial_backoff : float;max_backoff : float;ping_interval : float;
}Connection configuration
WebSocket connection handle.
Configuration
Create default configuration for a host and resource path.
Connection Management
Source
val create :
sw:Eio.Switch.t ->
net:'a Eio.Net.t ->
clock:float Eio.Time.clock_ty Eio.Resource.t ->
host:string ->
resource:string ->
?ping_interval:float ->
?buffer_size:int ->
unit ->
tCreate a new WebSocket connection. Does not connect immediately.
Messaging
Set the subscription message to send on (re)connect.
Get the stream of received messages.
Status
Ping Loop
Message Parsing
Source
val start_parsing_fiber :
sw:Eio.Switch.t ->
channel_name:string ->
conn:t ->
parse:(string -> 'a list) ->
output_stream:'a Eio.Stream.t ->
unitStart a message parsing fiber that reads from a connection's raw stream, parses messages using the provided function, and adds them to the output stream.
Handles cancellation and errors with consistent logging.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page