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

com.github.thorbenkuck.network.stream.StrictEventStream Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package com.github.thorbenkuck.network.stream;

import com.github.thorbenkuck.network.exceptions.EmptySubscriberListException;

import java.util.List;

public class StrictEventStream extends AbstractEventStream {

	@Override
	protected void dispatch(List> notifiableSubscriptions, T t) {
		if (notifiableSubscriptions.isEmpty()) {
			throw new EmptySubscriberListException("No Subscribers found for " + t);
		}

		notifiableSubscriptions.forEach(concreteSubscription -> concreteSubscription.notify(t));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy