public class KxReactiveStreams
extends org.nustaq.kontraktor.Actors
| Modifier and Type | Field and Description |
|---|---|
protected int |
batchSize |
static int |
DEFBATCHSIZE |
static int |
DEFQSIZE |
protected static KxReactiveStreams |
instance |
static int |
MAX_BATCH_SIZE |
static int |
REQU_NEXT_DIVISOR |
| Constructor and Description |
|---|
KxReactiveStreams()
each KxReactiveStreams instance has a dedicated thread which is used for all its processors.
|
KxReactiveStreams(boolean keepSchedulerAlive) |
KxReactiveStreams(int batchSize,
int queueSize,
boolean keepSchedulerAlive) |
| Modifier and Type | Method and Description |
|---|---|
<T> KxPublisher<T> |
asKxPublisher(org.reactivestreams.Publisher<T> p)
interop, obtain a RxPublisher from an arbitrary rxstreams publisher.
|
<T> KxPublisher<T> |
connect(Class<T> eventType,
org.nustaq.kontraktor.remoting.base.ConnectableActor connectable) |
<T> org.nustaq.kontraktor.IPromise<KxPublisher<T>> |
connect(Class<T> eventType,
org.nustaq.kontraktor.remoting.base.ConnectableActor connectable,
org.nustaq.kontraktor.Callback<org.nustaq.kontraktor.remoting.base.ActorClientConnector> disconHandler) |
static KxReactiveStreams |
get() |
int |
getBatchSize() |
<T> Iterator<T> |
iterator(org.reactivestreams.Publisher<T> pub)
warning: blocks the calling thread.
|
<T> Iterator<T> |
iterator(org.reactivestreams.Publisher<T> pub,
int batchSize)
warning: blocks the calling thread.
|
<IN,OUT> org.reactivestreams.Processor<IN,OUT> |
newAsyncProcessor(Function<IN,OUT> processingFunction)
create async processor.
|
<IN,OUT> org.reactivestreams.Processor<IN,OUT> |
newAsyncProcessor(Function<IN,OUT> processingFunction,
int batchSize)
create async processor.
|
<IN,OUT> org.reactivestreams.Processor<IN,OUT> |
newAsyncProcessor(Function<IN,OUT> processingFunction,
org.nustaq.kontraktor.Scheduler sched,
int batchSize)
create async processor.
|
<T,OUT> org.reactivestreams.Processor<T,OUT> |
newLossyProcessor(Function<T,OUT> processingFunction,
int batchSize) |
<IN,OUT> org.reactivestreams.Processor<IN,OUT> |
newSyncProcessor(Function<IN,OUT> processingFunction)
create sync processor.
|
<T> KxPublisher<T> |
produce(Collection<T> collection) |
KxPublisher<Double> |
produce(DoubleStream stream) |
<T> KxPublisher<T> |
produce(int batchSize,
Iterator<T> iter) |
KxPublisher<Integer> |
produce(IntStream stream) |
<T> KxPublisher<T> |
produce(int batchSize,
Stream<T> stream) |
<T> KxPublisher<T> |
produce(Iterator<T> iter) |
KxPublisher<Long> |
produce(LongStream stream) |
<T> KxPublisher<T> |
produce(Stream<T> stream) |
<OUT> org.nustaq.kontraktor.IPromise |
serve(org.reactivestreams.Publisher<OUT> source,
org.nustaq.kontraktor.remoting.base.ActorPublisher networRxPublisher,
boolean closeConnectionOnCompleteOrError,
Consumer<org.nustaq.kontraktor.Actor> disconCB)
exposes a publisher on the network via kontraktor's generic remoting.
|
<T> Stream<T> |
stream(org.reactivestreams.Publisher<T> pub)
warning: blocks the calling thread.
|
<T> Stream<T> |
stream(org.reactivestreams.Publisher pub,
int batchSize)
warning: blocks the calling thread.
|
<T> org.reactivestreams.Subscriber<T> |
subscriber(org.nustaq.kontraktor.Callback<T> cb)
consuming endpoint.
|
<T> org.reactivestreams.Subscriber<T> |
subscriber(int batchSize,
org.nustaq.kontraktor.Callback<T> cb)
consuming endpoint.
|
void |
terminateScheduler()
tell the execution thread to stop as soon no actors are scheduled on it.
|
AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsBufferedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, race, race, reject, resolve, resolve, stream, SubmitDelayed, yield, yield, yieldCallbackspublic static final int MAX_BATCH_SIZE
public static final int DEFQSIZE
public static final int DEFBATCHSIZE
public static int REQU_NEXT_DIVISOR
protected static KxReactiveStreams instance
protected int batchSize
public KxReactiveStreams()
public KxReactiveStreams(boolean keepSchedulerAlive)
public KxReactiveStreams(int batchSize,
int queueSize,
boolean keepSchedulerAlive)
public static KxReactiveStreams get()
public int getBatchSize()
public void terminateScheduler()
public <T> KxPublisher<T> asKxPublisher(org.reactivestreams.Publisher<T> p)
T - p - public <T> org.reactivestreams.Subscriber<T> subscriber(org.nustaq.kontraktor.Callback<T> cb)
subscriber( (event, err) -> {
if (Actors.isComplete(err)) {
System.out.println("complete");
} else if (Actors.isError(err)) {
System.out.println("ERROR");
} else {
// process event
}
}
T - public <T> org.reactivestreams.Subscriber<T> subscriber(int batchSize,
org.nustaq.kontraktor.Callback<T> cb)
subscriber( (event, err) -> {
if (Actors.isComplete(err)) {
System.out.println("complete");
} else if (Actors.isError(err)) {
System.out.println("ERROR");
} else {
// process event
}
}
T - public <T> KxPublisher<T> connect(Class<T> eventType, org.nustaq.kontraktor.remoting.base.ConnectableActor connectable)
public <T> KxPublisher<T> produce(Stream<T> stream)
public <T> KxPublisher<T> produce(Collection<T> collection)
public KxPublisher<Integer> produce(IntStream stream)
public KxPublisher<Long> produce(LongStream stream)
public KxPublisher<Double> produce(DoubleStream stream)
public <T> KxPublisher<T> produce(int batchSize, Stream<T> stream)
public <T> KxPublisher<T> produce(Iterator<T> iter)
public <T> KxPublisher<T> produce(int batchSize, Iterator<T> iter)
public <T> Stream<T> stream(org.reactivestreams.Publisher<T> pub)
public <T> Stream<T> stream(org.reactivestreams.Publisher pub, int batchSize)
public <T> Iterator<T> iterator(org.reactivestreams.Publisher<T> pub)
public <T> Iterator<T> iterator(org.reactivestreams.Publisher<T> pub, int batchSize)
public <T> org.nustaq.kontraktor.IPromise<KxPublisher<T>> connect(Class<T> eventType, org.nustaq.kontraktor.remoting.base.ConnectableActor connectable, org.nustaq.kontraktor.Callback<org.nustaq.kontraktor.remoting.base.ActorClientConnector> disconHandler)
T - eventType - connectable - disconHandler - - can be nullpublic <OUT> org.nustaq.kontraktor.IPromise serve(org.reactivestreams.Publisher<OUT> source,
org.nustaq.kontraktor.remoting.base.ActorPublisher networRxPublisher,
boolean closeConnectionOnCompleteOrError,
Consumer<org.nustaq.kontraktor.Actor> disconCB)
OUT - source - networRxPublisher - - the appropriate network publisher (TCP,TCPNIO,WS)disconCB - - called once a client disconnects/stops. can be nullpublic <IN,OUT> org.reactivestreams.Processor<IN,OUT> newAsyncProcessor(Function<IN,OUT> processingFunction)
IN - OUT - processingFunction - public <IN,OUT> org.reactivestreams.Processor<IN,OUT> newAsyncProcessor(Function<IN,OUT> processingFunction, int batchSize)
IN - OUT - processingFunction - batchSize - public <IN,OUT> org.reactivestreams.Processor<IN,OUT> newAsyncProcessor(Function<IN,OUT> processingFunction, org.nustaq.kontraktor.Scheduler sched, int batchSize)
IN - OUT - processingFunction - sched - batchSize - public <IN,OUT> org.reactivestreams.Processor<IN,OUT> newSyncProcessor(Function<IN,OUT> processingFunction)
IN - OUT - processingFunction - public <T,OUT> org.reactivestreams.Processor<T,OUT> newLossyProcessor(Function<T,OUT> processingFunction, int batchSize)
Copyright © 2016. All rights reserved.