View Source Cachex.Router (Cachex v3.6.0)

Routing module to dispatch Cachex actions to their execution environment.

This module acts as the single source of dispatch within Cachex. In prior versions the backing actions were called directly from the main interface and were wrapped in macros, which was difficult to maintain and also quite noisy. Now that all execution flows via the router, this is no longer an issue and it also serves as a gateway to distribution in the future.

Link to this section Summary

Functions

Dispatches a call to an appropriate execution environment.

Executes a previously dispatched action.

Link to this section Functions

Link to this macro

call(cache, call)

View Source (macro)

Dispatches a call to an appropriate execution environment.

This acts as a macro just to avoid the overhead of slicing up module names are runtime, when they can be guaranteed at compile time much more easily.

Link to this macro

execute(cache, module, call)

View Source (macro)

Executes a previously dispatched action.

This macro should not be called externally; the only reason it remains public is due to the code injected by the dispatch/2 macro.