All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog2.shared.buffers.WorkHandler Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
/*
 * Copyright (C) 2020 Graylog, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Server Side Public License, version 1,
 * as published by MongoDB, Inc.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Server Side Public License for more details.
 *
 * You should have received a copy of the Server Side Public License
 * along with this program. If not, see
 * .
 */
package org.graylog2.shared.buffers;

/**
 * Based on the original WorkHandler interface.
 * This was previously used for handlers which are part of a worker pool but the functionality was removed from the
 * disruptor library. We are keeping the interface but workers implementing it won't be able to use the batching
 * semantics that an {@link com.lmax.disruptor.EventHandler} provides.
 */
public interface WorkHandler {
    void onEvent(T event) throws Exception;

    /**
     * Called once on thread start before first event is available.
     */
    default void onStart() {
    }

    /**
     * 

Called once just before the thread is shutdown.

*

* Sequence event processing will already have stopped before this method is called. No events will * be processed after this message. */ default void onShutdown() { } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy