001/* 002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others 003 * 004 * This program and the accompanying materials are made available under the 005 * terms of the Eclipse Public License 2.0 which is available at 006 * http://www.eclipse.org/legal/epl-2.0. 007 * 008 * SPDX-License-Identifier: EPL-2.0 009 */ 010 011package gololang.concurrent.workers; 012 013/** 014 * A worker function for asynchronously processing messages. 015 * <p> 016 * This interface is mostly used to facilitate the design of the Java API, as worker functions are made out of 017 * function references in Golo. 018 */ 019@FunctionalInterface 020public interface WorkerFunction { 021 022 /** 023 * Called by a worker executor to process a message. 024 * 025 * @param message the message to process. 026 */ 027 void apply(Object message); 028}