Skip to content

Export SenderOptions class

Latest
Compare
Choose a tag to compare
@glasstiger glasstiger released this 14 Aug 23:10
· 1 commit to main since this release

A maintenance release to fix exports in the library.
SenderOptions was exported only as a type, its methods were not available for use.
Many thanks to @nicochatzi for providing the fix!

This release also exports the createBuffer() and createSender() factory functions, so now we can do this:

    const options: SenderOptions = await SenderOptions.fromConfig('http::addr=localhost:9000');
    const buffer: SenderBuffer = createBuffer(options);
    const transport: SenderTransport = createTransport(options);
    
    buffer.table("test").symbol("sym", "sym1").floatColumn("fp64", 1.123).atNow();
    await transport.send(buffer.toBufferNew());
    await transport.close();

By pooling a number of buffer and transport objects, and implementing our own the flushing strategy, potentially can reach better performance than just simply using Sender instances.