protected Stream<T> createWindowStream() { Broadcaster<T> action = timer != null && dispatcher == SynchronousDispatcher.INSTANCE ? SerializedBroadcaster.<T>create(environment, dispatcher) : Broadcaster.<T>create(environment, dispatcher); ReactiveSubscription<T> _currentWindow = new ReactiveSubscription<T>(null, action); currentWindow = _currentWindow; action.onSubscribe(_currentWindow); return action; }
/** * Build a {@literal Broadcaster}, ready to broadcast values with {@link reactor.rx.action * .Broadcaster#onNext(Object)}, * {@link Broadcaster#onError(Throwable)}, {@link Broadcaster#onComplete()}. * Values broadcasted are directly consumable by subscribing to the returned instance. * * A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time. * The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns. * * @param <T> the type of values passing through the {@literal action} * @return a new {@link reactor.rx.action.Action} */ public static <T> Broadcaster<T> create() { return new SerializedBroadcaster<>(null, SynchronousDispatcher.INSTANCE, Long.MAX_VALUE); }
/** * @see {@link org.reactivestreams.Subscriber#onNext(Object)} */ @Override public void onNext(O ev) { try { serializer.onNext(ev); } catch (Throwable cause) { doError(Exceptions.addValueAsLastCause(cause, ev)); } }
protected Stream<T> createWindowStream() { Broadcaster<T> action = timer != null && dispatcher == SynchronousDispatcher.INSTANCE ? SerializedBroadcaster.<T>create(environment, dispatcher) : Broadcaster.<T>create(environment, dispatcher); ReactiveSubscription<T> _currentWindow = new ReactiveSubscription<T>(null, action); currentWindow = _currentWindow; action.onSubscribe(_currentWindow); return action; }
/** * Build a {@literal Broadcaster}, ready to broadcast values, ready to broadcast values with {@link * Broadcaster#onNext(Object)}, * {@link Broadcaster#onError(Throwable)}, {@link Broadcaster#onComplete()}. * Values broadcasted are directly consumable by subscribing to the returned instance. * * A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time. * The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns. * * @param env the Reactor {@link reactor.Environment} to use * @param <T> the type of values passing through the {@literal Broadcaster} * @return a new {@link Broadcaster} */ public static <T> Broadcaster<T> create(Environment env) { return new SerializedBroadcaster<>(env, SynchronousDispatcher.INSTANCE, Long.MAX_VALUE); }
/** * @see {@link org.reactivestreams.Subscriber#onNext(Object)} */ @Override public void onNext(O ev) { try { serializer.onNext(ev); } catch (Throwable cause) { doError(Exceptions.addValueAsLastCause(cause, ev)); } }
final ZContext zmq = (null != zmqOpts ? zmqOpts.context() : null); final Broadcaster<ZMsg> broadcaster = SerializedBroadcaster.create(getDefaultEnvironment());
/** * Build a {@literal Broadcaster}, ready to broadcast values, ready to broadcast values with {@link * Broadcaster#onNext(Object)}, * {@link Broadcaster#onError(Throwable)}, {@link Broadcaster#onComplete()}. * Values broadcasted are directly consumable by subscribing to the returned instance. * * A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time. * The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns. * * @param env the Reactor {@link reactor.Environment} to use * @param <T> the type of values passing through the {@literal Broadcaster} * @return a new {@link Broadcaster} */ public static <T> Broadcaster<T> create(Environment env) { return new SerializedBroadcaster<>(env, SynchronousDispatcher.INSTANCE, Long.MAX_VALUE); }
ZContext zmq = (null != zmqOpts ? zmqOpts.context() : null); Broadcaster<ZMsg> broadcaster = SerializedBroadcaster.create(getDefaultEnvironment());
/** * Build a {@literal Broadcaster}, ready to broadcast values with {@link reactor.rx.action * .Broadcaster#onNext(Object)}, * {@link Broadcaster#onError(Throwable)}, {@link Broadcaster#onComplete()}. * Values broadcasted are directly consumable by subscribing to the returned instance. * * A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time. * The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns. * * @param <T> the type of values passing through the {@literal action} * @return a new {@link reactor.rx.action.Action} */ public static <T> Broadcaster<T> create() { return new SerializedBroadcaster<>(null, SynchronousDispatcher.INSTANCE, Long.MAX_VALUE); }