Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
SortOfTested24915215dI mean, I love akka, and I love FP. I'd encourage the FP route for actor model in most cases, but typed/class-oriented can be easier if you are used to OOP.
FP isn't really hard, it's just rigorous. You're defining types and states they go through in your application rather than data with operations. The end going being to make your software "provable."
IntrusionCM5209215d@SortOfTested Yes. Actually I was amazed how natural Akka felt (except for some Java*isms).
My pain point with the Akka examples was the Java concept of nested classes (totally forgot to mention, oopsie).
It's... for me a broken concept.
My brain went into panic state because I read Command multiple times without realizing that the nested class (eg DeviceGroup.Command) was meant...
I must read about that part at the weekend, because I actually don't want to go that way... It reminds me too much of PHP class goo (one file... Oh so many classes).
Otherwise, I think FP and I are somehow already friends.
I always liked OOP design mixed with elements of FP. My DTOs are value objects, hence not mutable. My actors never mutate inner variables, only initialize them. Everything "in" and "out" are DTOs / value objects...
(one very painful lesson from PHP - as in a loosely typed language mutating stuff can lead to a hell of lobotomy, since even changing the type is possible, which leads to a nightmare of debugging)
IntrusionCM5209210dWell. It works. Not.
I've rewrote everything. Which was a PITA.
I've finished this morning...
Stream from Source
Well. Seems like I got it all wrong.
It pulls (Source) exactly one time.
When I add an backpressureTimeout it suddenly works and pulls multiple times, until it suddenly dies.
It took me 10 hours to reach this phase... Very frustrating.
@SortOfTested Just out of curiosity.... Do you know of any example with Actors and Backpressure?
I just don't grok the examples.
If you are intending to ask multiple actors by using Actor routers, then you should use mapAsyncUnordered and perform the ask manually in there, as the ordering of the replies is not important, since multiple actors are being asked concurrently to begin with, and no single actor is the one to be watched by the operator.
I dunno how to combine mapAsyncUnordered with Patterns.ask... or getContext().ask()...
Will try tomorrow throwing more poo at it, but currently I'm at a fuck everything stage.
IntrusionCM5209209d@SortOfTested it's resolved.
*cries in spanish*
My mistake was to look at the wrong place.
Akka.Actor.Typed.Javadsl.AskPattern has a CompletionStage .
ActorFlow.ask seems to need to emit some signal, so it doesnt't work either.
getContext().ask() has no CompletionStage. -.-
But my migration was successful. After nearly 2 days to find this motherfucking stupid function everything works FAST.
All hail Ctulhu!