Creates a new FluentClient
A prefix to prefix to all tags. For example, passing the prefix "foo" will cause emit("bar", data)
to emit with foo.bar
.
The client options
Attaches an event listener to the underlying socket
See FluentSocketEvent for more info
Emits an event to the Fluent Server
The event to emit (required)
A Promise, which resolves when the event is successfully sent to the server. Enabling acknowledgements waits until the server indicates they have received the event.
Emits an event to the Fluent Server
The event to emit (required)
A millisecond resolution timestamp to associate with the event (optional)
A Promise, which resolves when the event is successfully sent to the server. Enabling acknowledgements waits until the server indicates they have received the event.
Emits an event to the Fluent Server
The label to emit the data with (optional)
The event to emit (required)
A Promise, which resolves when the event is successfully sent to the server. Enabling acknowledgements waits until the server indicates they have received the event.
Emits an event to the Fluent Server
The label to emit the data with (optional)
The event to emit (required)
A millisecond resolution timestamp to associate with the event (optional)
A Promise, which resolves when the event is successfully sent to the server. Enabling acknowledgements waits until the server indicates they have received the event.
Connects the client. Can happen automatically during construction, but can be called after a disconnect()
to resume the client.
Closes the socket, and clears both the ackQueue and the sendQueue, rejecting all pending events.
For use during shutdown events, where we don't plan on reconnecting
Closes the socket and clears the ackQueue. Keeps pending events, which can be sent via a later .connect()
Flushes to the socket synchronously
Prefer calling .flush
which will flush on the next tick, allowing events from this tick to queue up.
true if there are more events in the queue to flush, false otherwise
Flushes the event queue. Queues up the flushes for the next tick, preventing multiple flushes at the same time.
A promise, which resolves with a boolean indicating if there are more events to flush.
Waits for all currently pending events to successfully resolve or reject
A Promise which resolves once all the pending events have successfully been emitted
Returns the number of queued events that haven't been sent yet
Useful to react if we're queuing up too many events within a single tick
Returns whether or not the socket is writable
Useful to react if we're disconnected for any reason
Returns the number of events that have been queued, but haven't resolved yet
This includes acknowledgements and retries if enabled.
Generated using TypeDoc
A Fluent Client. Connects to a FluentD server using the Forward protocol.