@Override
    public Worker createWorker() {
        return new Worker() {

            private volatile boolean unsubscribed;

            @Override
            public void unsubscribe() {
                unsubscribed = true;
            }

            @Override
            public boolean isUnsubscribed() {
                return unsubscribed;
            }

            @Override
            public Subscription schedule(Action0 action) {
                if (executor.inEventLoop()) {
                    action.call();
                    return Subscriptions.unsubscribed();
                } else {
                    ScheduledAction sa = new ScheduledAction(action);
                    executor.execute(sa);
                    return sa;
                }
            }

            @Override
            public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
                throw new NotImplementedException();
            }
        };
    }
A custom {@link Scheduler} for use with a {@link EventExecutor} that
1) Ensures that every action is run on the EventExecutor thread
2) avoids the unnecessary executions that occur from using {@link rx.internal.schedulers.ExecutorScheduler} if already
executing on the correct thread

Should only be used with {@link io.netty.channel.SingleThreadEventLoop}

@author Justin Guerra
@since 5/19/25
zuul-core/src/main/java/com/netflix/zuul/netty/filter/EventExecutorScheduler.java