-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoteWorkUnit.java
More file actions
28 lines (23 loc) · 895 Bytes
/
RemoteWorkUnit.java
File metadata and controls
28 lines (23 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
/**
* A work unit designed to be run remotely.
*/
public interface RemoteWorkUnit extends Callable<RemoteResult>, Serializable
{
/** For serialization. */
public static final long serialVersionUID = 1L;
/** For assigning unique IDs. */
public static final AtomicLong ID_GENERATOR = new AtomicLong();
/** Performs the work. This should send the result back by using {@link Client#sendResult(RemoteResult)}. */
public RemoteResult call();
/** Provides a text description of this work unit. */
public String toString();
/**
* Provides a unique server-generated number that identifies this work unit so that its
* corresponding Result can be put into the right pile.
* @return the serial number of this work unit
*/
public long getServerID();
}