All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.englishtown.promises.internal.handlers.AsyncHandler Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show newest version
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