@Override
    public <T> Future<T> background(final BackgroundAction<T> action) {
        if(registry.contains(action)) {
            log.warn(String.format("Skip duplicate background action %s found in registry", action));
            return ConcurrentUtils.constantFuture(null);
        }
        return DefaultBackgroundExecutor.get().execute(this, registry, action);
    }
@Test
    public void testBackground() throws Exception {
        final AbstractController controller = new AbstractController() {
            @Override
            public void invoke(final MainAction runnable, final boolean wait) {
                runnable.run();
            }
        };
        final AbstractBackgroundAction<Object> action = new RegistryBackgroundAction<Object>(controller, SessionPool.DISCONNECTED) {
            @Override
            public void init() {
                assertEquals("main", Thread.currentThread().getName());
            }

            @Override
            public Object run(final Session<?> session) {
                return null;
            }

            @Override
            public void cleanup() {
                super.cleanup();
                assertFalse(controller.getRegistry().contains(this));
            }

        };
        controller.background(action).get();
    }