Chronicle.Correlation.CorrelationIdManager (cratis_chronicle v0.2.0)

Copy Markdown View Source

Process-scoped correlation id manager.

This provides an idiomatic Elixir alternative to AsyncLocalStorage-based context in other clients by using the process dictionary.

Summary

Functions

Clears the current correlation id and replaces it with a new generated id.

Gets the current correlation id for the calling process.

Sets the current correlation id for the calling process.

Functions

clear()

Clears the current correlation id and replaces it with a new generated id.

current()

Gets the current correlation id for the calling process.

If no correlation id has been set, a new one is generated and returned.

set_current(correlation_id)

Sets the current correlation id for the calling process.

Accepts either a %Chronicle.Correlation.CorrelationId{} or a raw string id.