Strand class & continuation example

Arkadiusz Gasiński jigga at
Wed Jan 30 18:11:50 UTC 2019


I assume that you're all busy with the loom project, but if anyone here
finds some time to briefly explain the rationale behind removal of the
Strand class, I'll be really grateful.

I tried to find some explanation in the mailing list archive, but to no

Also, if you could provide some very basic example of Continuation usage
without involving Fibers as I'm struggling with the below code (perhaps I
got the whole idea wrong):

var scope = new ContinuationScope("main");

Continuation cont = new Continuation(scope, () -> {
   while (true) {
      // do very important stuff

while (!cont.isDone()) {
   // try yield the continuation
   // sleep some
   try {
   } catch (InterruptedException e) {
      // ignore
   } finally {;

As you probably guess by now, I can't get past the first call as
it block main. If I run the continuation for the first time in a separate
thread, then Continuation.yield(scope) throws IllegalArgumentException("Not
in scope " + scope).

So basically what I'd like to achieve is to run some continuation, yield it
after a while and then resume it from where it was before yielding, if of
course, this is possible.


More information about the loom-dev mailing list