
com.englishtown.promises.internal.handlers.AsyncHandler Maven / Gradle / Ivy
package com.englishtown.promises.internal.handlers;
import com.englishtown.promises.internal.Continuation;
import com.englishtown.promises.internal.ContinuationTask;
import com.englishtown.promises.internal.PromiseHelper;
/**
* Wrap another handler and force it into a future stack
*/
public class AsyncHandler extends DelegateHandler {
public AsyncHandler(Handler handler, PromiseHelper helper) {
super(handler, helper);
}
@Override
public void when(Continuation continuation) {
helper.getScheduler().enqueue(new ContinuationTask<>(continuation, this.join()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy