Hi all,
I’m developing a custom Akka source using GraphStage in Java.
I’m noticing that if during onPull()
, no element is pushed, the stage is stuck.
Is my understanding incorrect that onPull()
should be called again if no element was pushed?
Thanks!
{
setHandler(out, new AbstractOutHandler() {
@Override
public void onPull() throws Exception {
if (count++ > 1000) {
completeStage();
return;
}
if (count % 2 != 0) {
Integer n = rand.nextInt(100);
buffer.add(n);
push(out, n);
} else {
// if this block is entered, source will be stuck
return;
}
}
});
}
5 posts - 3 participants