You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have recently found Pykka and really enjoy playing with it. During my Pykka sessions the following issue emerged:
My application has a RootActor, ManagerActor and EventActor. I need to get a list of information about events, therefore i need to ask each event for its info. The request for the list of information comes from a web api, therefore the result must be returned immediately (or a future). My current solution is as follows:
But because of the nested asks the type of f is Future[Future[Future[List]]]. I somehow need to get rid of the nested Future.
I could maybe not ask the EventActors, but tell them to send their result back to ManagerActor and he would somehow collect the results, send them back to RootActor, but how would he fill them in the future he has no clue about (hidden somewhere in ask() implementation)?
How would you recommend to solve this?
Thanks for help!
This discussion was converted from issue #86 on December 15, 2020 11:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have recently found Pykka and really enjoy playing with it. During my Pykka sessions the following issue emerged:
My application has a RootActor, ManagerActor and EventActor. I need to get a list of information about events, therefore i need to ask each event for its info. The request for the list of information comes from a web api, therefore the result must be returned immediately (or a future). My current solution is as follows:
But because of the nested
asks
the type off
isFuture[Future[Future[List]]]
. I somehow need to get rid of the nestedFuture
.I could maybe not
ask
the EventActors, buttell
them to send their result back toManagerActor
and he would somehow collect the results, send them back to RootActor, but how would he fill them in the future he has no clue about (hidden somewhere inask()
implementation)?How would you recommend to solve this?
Thanks for help!
Beta Was this translation helpful? Give feedback.
All reactions