fromCallback
Callable
Type parameters
- TEvent: EventObject
- TInput = NonReducibleUnknown
Parameters
invokeCallback: InvokeCallback<TEvent, AnyEventObject, TInput>
The callback function used to describe the callback logic The callback function is passed an object with the following properties:
receive- A function that can send events back to the parent actor; the listener is then called whenever events are received by the callback actorsendBack- A function that can send events back to the parent actorinput- Data that was provided to the callback actorself- The parent actor of the callback actorsystem- The actor system to which the callback actor belongs The callback function can (optionally) return a cleanup function, which is called when the actor is stopped.
Returns CallbackActorLogic<TEvent, TInput>
Callback logic
An actor logic creator which returns callback logic as defined by a callback function.
Useful for subscription-based or other free-form logic that can send events back to the parent actor.
Actors created from callback logic (“callback actors”) can:
receivefunctionsendBackfunctionCallback actors are a bit different from other actors in that they:
onDone.getSnapshot().subscribe().stop()