Module lazy_callback

Module lazy_callback 

Source
Expand description

§Lazy Callbacks

When constructing callbacks we sometimes have a large distance between where the channel for the callback is created and where the initial callback will be created. Refactoring of this code is sometimes not possible. Here we provide LazyCallback. We use ‘lazy_callback()’ to generate a LazyCallback and a CallbackSetter. The LazyCallback works like a GenericCallback and can be used to execute callbacks in the receiver process. The CallbackSetter has a single consuming method of ‘set_callback’ which will set the callback that the LazyCallback will then execute on messages send to it.

This is achieved with having the LazyCallback having a back channel in single process mode that sets the GenericCallback. Hence, this is slightly less efficient than a GenericCallback

Structs§

CallbackSetter
LazyCallback
Basic struct for LazyCallback
LazyCallbackSetterVisitor 🔒

Enums§

CallbackSetterVariants 🔒
LazyCallbackVariants 🔒

Functions§

lazy_callback
A LazyCallback is a Callback that will be initialized at a later date. We return the ‘LazyCallback’ which is a GenericCallback. We also return a ‘CallbackSetter’ where the callback can be set at a later date.
lazy_callback_inprocess 🔒
This function should never be exported.
lazy_callback_ipc 🔒
This function should never be exported.