Re: [akka-user][deprecated] Akka Stream : MergeHub and BroadcastHub

2020-04-13 Thread Alexey Shuksto
> To be honest I'm not sure of how messages are handled when there are no active Source[T] instances consuming messages sent to Broadcast.sink[T]... > My impression is that they would be thrown away, and the bufferSize parameter to BroadcastHub.sink[T] only comes into play when there are one or

[akka-user] Ask not working if Future is used in receive partial method

2017-10-13 Thread Alexey Shuksto
Hi there, It's prohibited to leak and close over actor internals. In your case Future not only closes over 'sender()', which is very bad and causes timeout (cause by the time future is complete sender() is null), you also modify actor internal state inside it, assigning to 'student', which is

Re: [akka-user] [akka-streams] How to guarantee parallel execution of Sunflower?

2017-08-13 Thread Alexey Shuksto
Thanks, Patrick! One more question regarding'.async' -- is there any point in adding it to Merge/BroadcastHub stages or their materialized sinks/sources? -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >>

Re: [akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-08-07 Thread Alexey Shuksto
y > upstream failure leads to a completion of the stream. > > -- > Johan > Akka Team > > On Sat, Jul 29, 2017 at 8:17 AM, Alexey Shuksto <sei...@gmail.com > > wrote: > >> Hello hAkkers, >> >> In our project we use some number of flows that follow

Re: [akka-user] Flow.fromSinkAndSource and backpressure

2017-08-02 Thread Alexey Shuksto
Hi Konrad, Jeff was asking about 'backpressure propagation'. From my understanding that means that when source wasn't pulled, sink would not pull. And that's not how it works as you already mentioned. -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ:

[akka-user] Flow.fromSinkAndSource and backpressure

2017-08-02 Thread Alexey Shuksto
Nope. More so, completion of one of them would not cause completion of another and flow itself. -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives:

[akka-user] [akka-stream] How to provide flow with 'last seen element' backup?

2017-07-29 Thread Alexey Shuksto
Hello hAkkers, In our project we use some number of flows that follow same building logic: ``` val input: Source[T, NotUsed] = ??? val output = input.runWith(BroadcastHub.sink) output.runWith(Sink.ignore) ``` Sink.ignore here used to prevent BroadcastHub inner buffer overflow and, also, to

[akka-user] Message [akka.stream.impl.fusing.ActorGraphInterpreter$Resume$] was not delivered in 'completeStage()' of BidiStage

2017-06-06 Thread Alexey Shuksto
Hello hAkkers, I've got some filter-like bidi-stage that filters elements of second flow based on elements from first one. Like this: final class IOFilter[O] extends GraphStage[BidiShape[O, O, O, O]] { val inO1: Inlet[O] = Inlet("IOFilter.inO1") val inO2: Inlet[O] =

Re: [akka-user] [akka-streams] StreamConverters.fromOutputStream(..) stops processing messages

2017-05-16 Thread Alexey Shuksto
May 15, 2017 at 8:17 PM Alexey Shuksto <sei...@gmail.com > > wrote: > >> Hello hAkkers, >> >> Our app spawns multiple external processes (via >> java.util.Runtime.exec(..)) and then writes to STDIN of such processes via: >> ``` >> StreamConverte

[akka-user] [akka-streams] StreamConverters.fromOutputStream(..) stops processing messages

2017-05-15 Thread Alexey Shuksto
Hello hAkkers, Our app spawns multiple external processes (via java.util.Runtime.exec(..)) and then writes to STDIN of such processes via: ``` StreamConverters .fromOutputStream(() => process.getOutputStream, autoFlush = true) .runWith(MergeHub.source[]) ``` MergeHub is attached to output

[akka-user] [akka-stream] MergeHub slows consumption when Source with 'delay' is merged to it -- bug?

2017-03-27 Thread Alexey Shuksto
Hello hAkkers, I've got so very weird situation when 'MergeHub.source' with merged in it 'Source.repeat(..).delay(..)' slowly decreases consumption rate of materialized Sinks. Some simple synthetic test follows: import java.time.Instant import akka.actor.ActorSystem import

[akka-user] Strange test failure in `Flow.filter(..)` with test-kit TestSink

2016-10-21 Thread Alexey Shuksto
Hello hAkkers, Consider this simple test (scalatest 3.0.0, scalacheck 1.13.2 and akka-streams-testkit 2.4.11 is used): describe("Either") { implicit def noShrink[T]: Shrink[List[T]] = Shrink.shrinkAny it("should filter 'Either.Left(..)' objects") { forAll("left", "right.head",

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Alexey Shuksto
documentation for custom stages `in` pulled twice (both in `onPush()` and `onPull()`) and in code it is only pulled once. > > >> >> среда, 19 октября 2016 г., 15:23:04 UTC+3 пользователь √ написал: >> >>> >>> >>> On Wed, Oct 19, 2016 at 2:18 PM,

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Alexey Shuksto
nside" this one materialized flow. среда, 19 октября 2016 г., 15:23:04 UTC+3 пользователь √ написал: > > > > On Wed, Oct 19, 2016 at 2:18 PM, Alexey Shuksto <sei...@gmail.com > > wrote: > >> 2 Konrad: Yep, in original question I meant not 'DSL construction time' >&

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Alexey Shuksto
√ написал: > > Hi Alexey, > > Not only is it not thread-safe, but it also actively prevents multiple > materializations. > > Perhaps if you state your use-case we can suggest an alternative? > > On Wed, Oct 19, 2016 at 1:24 PM, Alexey Shuksto <sei...@gmail.com

[akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Alexey Shuksto
Hello hAkkers, Simple example: val zipper = BidiFlow.fromGraph(GraphDSL.create() { b => var counter = 0 val outbound = b.add(Flow[String].map { str => counter += 1 str -> counter }) val inbound = b.add(Flow[(String, Int)].map { pair => counter -= 1 pair._1 })

[akka-user] Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Alexey Shuksto
Hello hAkkers! We've got some very strange message delivery time pattern between actors: We have system with ~2000 type "A" working actors, each of whom have 1 to 50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms between request and response). Every type A actor every

Re: [akka-user] Is there PromisedActorRef for everyone?

2016-06-28 Thread Alexey Shuksto
Yep but I will need to give some names to this proxy actors. Also, they would be supervised by '/user' and not by extension actor manager and won't form a nice and neat ActorPath tree like: '/user/extension/actor1', '/user/extension/actor2/' etc. Basically, "proxy" actors is what I use right

Re: [akka-user] Is there PromisedActorRef for everyone?

2016-06-28 Thread Alexey Shuksto
Mostly I was waiting for some of Akka developers "blessing" to use ActorSelection instead of ActorPath for 1-to-1 tells. вторник, 28 июня 2016 г., 12:59:19 UTC+3 пользователь √ написал: > > Hi Alexey, > > How about using ActorSelection until you can't? :) > > On Tue, Jun 28,

[akka-user] Is there PromisedActorRef for everyone?

2016-06-28 Thread Alexey Shuksto
Hello hAkkers, I have a component, Akka Extension, to be exact, which has one managing actor supervising several "worker" actors ()with different logic and roles). I want to be able to provide users of extension with stable ActorRef's of worker actors: class MyExtension(system:

[akka-user] [akka-stream] Is there a way to access Configuration from Flow?

2016-02-17 Thread Alexey Shuksto
Hello there, Is there a way to access run-time system configuration in GraphDSL.create(...) similar to as any Actor could access one via `context.system.settings.config`? I can, possibly do something like `flow.zip(Source.repeat(config))`, but maybe there is some approach that will not

Re: [akka-user] [akka-streams] ActorSubscriber to ActorPublisher flow -- how to?

2015-08-21 Thread Alexey Shuksto
)(_.future)`? 3. Will Sink.actorSubscriber(..) shutdown underlying actor after stream is completed or it needs to be done from actor itself after OnComplete event? And what about errors? четверг, 20 августа 2015 г., 18:33:43 UTC+3 пользователь Alexey Shuksto написал: Well, I want to simply connect

[akka-user] [akka-streams] ActorSubscriber to ActorPublisher flow -- how to?

2015-08-20 Thread Alexey Shuksto
Hello there, I could not find answer to this particular question neither in docs nor in this group: Is it possible to wire Sink.actorSubscriber(...) into Source.actorPublisher(...) in one (Partial-) Flow? And by 'wire' I mean to somehow send message from ActorSubscriber, instantiated from