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§
- Callback
Setter - Lazy
Callback - Basic struct for LazyCallback
- Lazy
Callback 🔒Setter Visitor
Enums§
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.