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

com.opencredo.concourse.domain.events.publishing.EventSubscribable Maven / Gradle / Ivy

package com.opencredo.concourse.domain.events.publishing;

import com.opencredo.concourse.domain.events.Event;
import com.opencredo.concourse.domain.events.EventType;

import java.util.function.Consumer;

/**
 * A receiver of {@link Event}s that forwards them to subscribed handlers by {@link EventType}.
 */
@FunctionalInterface
public interface EventSubscribable {

    /**
     * Register a handler to handle {@link Event}s of the given {@link EventType}.
     * @param eventType The type of event handled by the handler.
     * @param handler The handler to register.
     * @return The {@link EventSubscribable}, for method chaining.
     */
    EventSubscribable subscribe(EventType eventType, Consumer handler);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy