---
source: boltffi_bindgen/src/render/csharp/templates.rs
expression: template.render().unwrap()
---

    internal static class BoltFFIStream
    {
        internal const int DefaultBatchSize = 16;
        internal const int WaitTimeoutMilliseconds = 50;
        internal const int WaitResultUnsubscribed = -1;
    }


    internal static class NativeMethods
    {
        internal const string LibName = "demo";

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_free")]
        internal static extern void EventBusFree(IntPtr handle);

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_subscribe_values")]
        internal static extern IntPtr EventBusSubscribeValues(IntPtr handle);

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_subscribe_values_pop_batch")]
        internal static extern UIntPtr EventBusSubscribeValuesPopBatch(IntPtr subscription, IntPtr outputPtr, UIntPtr outputCapacity);

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_subscribe_values_wait")]
        internal static extern int EventBusSubscribeValuesWait(IntPtr subscription, int timeoutMilliseconds);

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_subscribe_values_unsubscribe")]
        internal static extern void EventBusSubscribeValuesUnsubscribe(IntPtr subscription);

        [DllImport(LibName, EntryPoint = "boltffi_event_bus_subscribe_values_free")]
        internal static extern void EventBusSubscribeValuesFree(IntPtr subscription);
    }
}
