Can I have custom operators?

Learn how to implement your own operator.

Yes, but please write operators responsibly!

Both Uni and Multi support custom operators using the plug operator. Here is an example where we use a custom Multi operator that randomly drops items:

        .range(1, 101)

with the operator defined as follows:

public class RandomDrop<T> extends AbstractMultiOperator<T, T> {
    public RandomDrop(Multi<? extends T> upstream) {

    public void subscribe(MultiSubscriber<? super T> downstream) {
        upstream.subscribe().withSubscriber(new DropProcessor(downstream));

    private class DropProcessor extends MultiOperatorProcessor<T, T> {
        DropProcessor(MultiSubscriber<? super T> downstream) {

        public void onItem(T item) {
            if (ThreadLocalRandom.current().nextBoolean()) {

Custom operators are an advanced feature: when possible please use the existing operators and use helpers such as stage to write readable code. In the case of custom Multi operators it is wise to test them against the Reactive Streams TCK.