Contexir.Context (Contexir v0.2.0)

View Source

Manages the process-local active layer stack and shared context map.

Summary

Functions

Returns the current process-local context.

Returns a value from the current context.

Sets a value in the current context.

Updates a value in the current context.

Runs a function with a temporary process-local context.

This is where everything gets executed.

Runs a function with temporary active layers and context.

Functions

activate(layer)

active_layers()

current()

Returns the current process-local context.

deactivate(layer)

get(key, default \\ nil)

Returns a value from the current context.

get_ctx()

put(key, value)

Sets a value in the current context.

set_ctx(ctx)

update(key, initial, fun)

Updates a value in the current context.

update_ctx(fun)

with_context(ctx, fun)

Runs a function with a temporary process-local context.

with_layers(layers, mod, fun, args)

This is where everything gets executed.

with_scope(layers, ctx, fun)

Runs a function with temporary active layers and context.