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

org.jetlang.channels.Subscriber Maven / Gradle / Ivy

Go to download

Jetlang provides a high performance java threading library. It is a complement to the java.util.concurrent package introduced in 1.5 and should be used for message based concurrency similar to event based actors in Scala.

There is a newer version: 0.2.23
Show newest version
package org.jetlang.channels;

import org.jetlang.core.Callback;
import org.jetlang.core.Disposable;
import org.jetlang.core.DisposingExecutor;

/**
 * Interface for components that allow for message subscriptions
 *
 * @param  Type of messages a subscription will be for
 */
public interface Subscriber {
    /**
     * Subscribe to receive messages produced by this subscriber
     *
     * @param executor {@link DisposingExecutor} to use for invoking the callback upon message receipt.
     * @param receive  {@link Callback} to invoke upon message receipt
     * @return {@link Disposable} that can be invoked to cancel this subscription
     */
    Disposable subscribe(DisposingExecutor executor, Callback receive);

    Disposable subscribe(Subscribable sub);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy