ghosalmartin
05/17/2022, 9:59 AMasad.awadia
05/17/2022, 12:14 PMghosalmartin
05/17/2022, 12:44 PMCasey Brooks
05/17/2022, 2:38 PMactor
is marked obsolete)ghosalmartin
05/17/2022, 2:44 PMCasey Brooks
05/17/2022, 2:59 PM.actor()
is BufferOverflow
, which by default is SUSPEND
, but may be more useful to drop additional Intents if the buffer is full, to guarantee no deadlocks. For context, I’m writing an MVI library, ballast, which does exactly this same kind of thing.
Given that .actor
is effectively just an obsolete API over Channels but offers less functionality, you may be better-off just using a Channel directly. And with this use-case, it sounds like a single Channel is all you need, you don’t need a main one delegating to sub-channels (or sub-actors)ghosalmartin
05/17/2022, 3:03 PMCasey Brooks
05/17/2022, 3:12 PM.actor()
API does allow you to configure the capacity
so you could try it with .actor(capacity = Channel.BUFFERED)
or .actor(capacity = Channel.UNLIMITED)
, but it won’t allow you to configure the overflow behaviorghosalmartin
05/17/2022, 3:14 PMCasey Brooks
05/17/2022, 3:15 PMghosalmartin
05/17/2022, 3:22 PMawaits()
Casey Brooks
05/17/2022, 3:35 PMsideJob
in Ballastghosalmartin
05/18/2022, 9:18 PMCompletableDeferred
The problem am having is sometimes I do need to return data from these actor messages. I was using the CompletableDeferred
for that. This is all so much easier in swift 😂 add 1 keyword and away you go