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

io.github.vipcxj.jasync.ng.spec.spi.JPromiseSupport Maven / Gradle / Ivy

Go to download

JAsync implements Async-Await fashion for Java just like es and c#. This library provide the spec of all public api.

There is a newer version: 1.0.17
Show newest version
package io.github.vipcxj.jasync.ng.spec.spi;

import io.github.vipcxj.jasync.ng.spec.*;
import io.github.vipcxj.jasync.ng.spec.functional.JAsyncPortalTask1;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;

public interface JPromiseSupport extends PrioritySupport {
     JPromise just(T value);
     JPromise error(Throwable error);
    JPromise sleep(long time, TimeUnit unit);
     JPromise portal(JAsyncPortalTask1 task);
     JPromise any(List> promises);
    @SuppressWarnings("unchecked")
    default  JPromise any(JPromise... promises) {
        return any(Arrays.asList(promises));
    }
     JPromise race(List> promises);
    @SuppressWarnings("unchecked")
    default  JPromise race(JPromise... promises) {
        return race(Arrays.asList(promises));
    }
     JPromise> all(List> promises);
    @SuppressWarnings("unchecked")
    default  JPromise> all(JPromise... promises) {
        return all(Arrays.asList(promises));
    }
     JPromise create(BiConsumer, JContext> handler);
     JPromise generate(BiConsumer, JContext> handler);
    JPromiseTrigger createTrigger();
    int generateId();
    JAsyncReadWriteLock readWriteLock();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy