class GafferAdder implements Serializable {

    public void add(final Element element) {
        if (null == element) {
            return;
        }

        if (null == queue) {
            queue = new ConsumableBlockingQueue<>(maxQueueSize);
            restart = true;
        }

        try {
            queue.put(element);
        } catch (final InterruptedException e) {
            throw new RuntimeException("Interrupted while waiting to add an element to the queue", e);
        }

        if (restart && !queue.isEmpty()) {
            restart = false;
            store.runAsync(() -> {
                try {
                    store.execute(new AddElements.Builder()
                                    .input(queue)
                                    .validate(validate)
                                    .skipInvalidElements(skipInvalid)
                                    .build(),
                            new Context(new User()));
                    restart = true;
                } catch (final OperationException e) {
                    throw new RuntimeException(e.getMessage(), e);
                }
            });
        }
    }

    public <OP extends Validatable & Operation> GafferAdder(final OP operation, final Store store);

}