DataBuffer v0.3.0 DataBuffer behaviour View Source

Defines a data buffer.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Dumps data from the provided buffer - bypassing the flush operation.

Performs a flush operation on the provided buffer.

Inserts data into the provided buffer.

Returns the current size of the provided buffer.

Starts the data buffer as a supervisor process.

Syncronously flushes the provided buffer - returning the results.

Link to this section Types

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

dump(buffer, timeout \\ 5000)

View Source

Specs

dump(buffer :: t(), timeout()) :: [any()]

Dumps data from the provided buffer - bypassing the flush operation.

Link to this function

flush(buffer, timeout \\ 5000)

View Source

Specs

flush(buffer :: t(), timeout()) :: :ok

Performs a flush operation on the provided buffer.

Link to this function

insert(buffer, data, timeout \\ 5000)

View Source

Specs

insert(buffer :: t(), data :: any(), timeout()) :: :ok

Inserts data into the provided buffer.

Link to this function

size(buffer, timeout \\ 5000)

View Source

Specs

size(buffer :: t(), timeout()) :: integer()

Returns the current size of the provided buffer.

Link to this function

start_link(buffer, opts)

View Source

Specs

start_link(buffer :: t(), keyword()) :: Supervisor.on_start()

Starts the data buffer as a supervisor process.

Link to this function

sync_flush(buffer, timeout \\ 5000)

View Source

Specs

sync_flush(buffer :: t(), timeout()) :: [any()]

Syncronously flushes the provided buffer - returning the results.

Link to this section Callbacks

Link to this callback

handle_flush(arg1, meta)

View Source

Specs

handle_flush(Enumerable.t(), meta :: any()) :: any()