Default service implementation. Uses the Segment Batch HTTP API to put events in a FIFO queue and send on a regular basis.
config :segmentry,
max_batch_size: 100,
batch_every_ms: 5000:max_batch_size— maximum batch size sent per request. Default100.:batch_every_ms— interval (ms) between batch flushes. Default2000.
Segment limits batch requests to 500KB and individual calls to 32KB. The library does not
enforce this directly — keep max_batch_size low if your events are large. Segment also asks
callers to limit themselves to under 50 requests/second; do not set batch_every_ms under 20ms.
Summary
Functions
Enqueue a Segment event for the next batch. Must be a Track, Identify, Screen,
Alias, Group, or Page struct.
Returns a specification to start this module under a supervisor.
Force the batcher to flush the queue immediately.
Start the GenServer with a Segment HTTP Source API write key.
Functions
@spec call(Segmentry.segment_event()) :: :ok
Enqueue a Segment event for the next batch. Must be a Track, Identify, Screen,
Alias, Group, or Page struct.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec flush() :: :ok
Force the batcher to flush the queue immediately.
@spec start_link(String.t()) :: GenServer.on_start()
Start the GenServer with a Segment HTTP Source API write key.
@spec start_link( String.t(), keyword() ) :: GenServer.on_start()
Start the GenServer with a Segment HTTP Source API write key and a keyword list of Req
options. Used in tests to inject a Req.Test plug stub.