Hi
I'm trying to use a Valve (which is implemented via a GraphStage). The idea
is to close the valve when some Left is raised inside a stream. That seems
working ok.
One of the thing is that I'm stuck in the onPush handler, cause before
doing a push to the Outlet port, I have to validate if the valve is open,
but to do so, I have to access the DB and look for the actual state of the
valve. Something like this:
override def onPush(): Unit = {
state.map(
s =>
if (s == SwitchMode.Open) {
push(*out, grab(in)*)
}
)
}
Reading some logs, it seems to be working, but it's not. I have a test that
tries to get the message and is getting a timeout.
val probe = stream(group, topic) // this stream has a viaMat where the
graphstage is inserted
.runWith(TestSink.probe)
probe.requestNext() // here is the timeout
Is it possible to pause the consumer having this restriction or should I
try to do it in another way?
If this is the way to go, I'm concerned about what will happen when the
Valve gets open again. If the stream has a lot of messages, will the stream
capable of manage this or should I control that some way?
Regards
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.