package polymarket
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
OCaml client library for the Polymarket prediction market API
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.2.0.tar.gz
md5=4eb4c5d2f63ff081c9713d90be5a51b2
sha512=0e3de0c9b40683e09ab8f9f966a44784ef1b9b482c3eefef84104a7e8042c92f1d79893ee9588b24fa3d0decaed7f365509f4d1c23c66ce8328efb64e721f276
doc/polymarket.websocket/Websocket/Connection/index.html
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