Algostream_common_utils.Zero_copyZero-copy message passing for ultra-low latency trading
type message_header = {magic : int32;message_type : int32;sequence_id : int64;timestamp_ns : int64;payload_size : int32;checksum : int32;}Message header for zero-copy transport
module MessageType : sig ... endMessage type definitions
val create_channel :
channel_id:int ->
capacity:int ->
message_size:int ->
zero_copy_channelCreate a zero-copy channel
val connect_channel :
channel_id:int ->
capacity:int ->
message_size:int ->
zero_copy_channelConnect to an existing zero-copy channel
val close_channel : zero_copy_channel -> unitClose a zero-copy channel
val send_message : zero_copy_channel -> int32 -> bytes -> unitSend a message through the channel
val receive_message : zero_copy_channel -> (message_header * bytes) optionReceive a message from the channel
val try_receive_message : zero_copy_channel -> (message_header * bytes) optionTry to receive a message without blocking
module MarketDataZeroCopy : sig ... endSpecialized zero-copy structures for market data
type channel_stats = {messages_sent : int64;messages_received : int64;bytes_sent : int64;bytes_received : int64;avg_send_latency_ns : int64;avg_receive_latency_ns : int64;checksum_failures : int64;buffer_overflows : int64;}Channel statistics
module ZeroCopyMetrics : sig ... endPerformance monitoring for zero-copy channels
module ChannelManager : sig ... endChannel manager for handling multiple zero-copy channels