Skip to main content

net_init

Function net_init 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn net_init( config_json: *const c_char, ) -> *mut NetHandle
Expand description

Initialize a new event bus.

§Parameters

  • config_json: JSON configuration string (UTF-8, null-terminated). Pass NULL or empty string for default configuration.

§Returns

Opaque handle to the event bus, or NULL on failure. The handle must be freed with net_shutdown.

§Example Configuration

{
  "num_shards": 8,
  "ring_buffer_capacity": 1048576,
  "backpressure_mode": "DropOldest",
  "batch": {
    "min_size": 1000,
    "max_size": 10000,
    "max_delay_ms": 10
  }
}