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

reactor.groovy.support.ClosureTupleConsumer Maven / Gradle / Ivy

The newest version!
package reactor.groovy.support;

import groovy.lang.Closure;
import reactor.function.Consumer;
import reactor.tuple.Tuple;

/**
 * Invokes a {@link groovy.lang.Closure} using the contents of the incoming {@link reactor.tuple.Tuple} as the
 * arguments.
 *
 * @author Jon Brisbin
 */
public class ClosureTupleConsumer implements Consumer {

	private final Closure cl;

	public ClosureTupleConsumer(Closure cl) {
		this.cl = cl;
	}

	@Override
	public void accept(Tuple tup) {
		cl.call(tup.toArray());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy