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

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

There is a newer version: 2.0.8.RELEASE
Show newest version
package reactor.groovy.support;

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

/**
 * Invokes a {@link groovy.lang.Closure} using the contents of the incoming {@link reactor.fn.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 - 2025 Weber Informatics LLC | Privacy Policy