Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Fix for workers and function references
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Ponge <julien.ponge@insa-lyon.fr>
  • Loading branch information
Julien Ponge committed Jun 15, 2015
1 parent c320c2b commit dab5ddd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/gololang/concurrent/workers/WorkerEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

package gololang.concurrent.workers;

import java.lang.invoke.MethodHandle;
import gololang.FunctionReference;
import gololang.Predefined;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import static java.lang.invoke.MethodHandleProxies.asInterfaceInstance;

/**
* A worker environment is an abstraction over a set of spawned functions that can asynchronously process messages
* sent through ports.
Expand Down Expand Up @@ -100,11 +100,11 @@ public WorkerEnvironment withSingleThreadExecutor() {
/**
* Spawns a worker function.
*
* @param handle the worker target.
* @param func the worker target.
* @return a port to send messages to <code>handle</code>.
*/
public Port spawn(MethodHandle handle) {
return spawnWorker(asInterfaceInstance(WorkerFunction.class, handle));
public Port spawn(FunctionReference func) {
return spawnWorker((WorkerFunction) Predefined.asInterfaceInstance(WorkerFunction.class, func));
}

/**
Expand Down

0 comments on commit dab5ddd

Please sign in to comment.