#2934 - explaining send a bit better in the docs
This commit is contained in:
parent
68f3dd549d
commit
791bbd1565
3 changed files with 10 additions and 11 deletions
|
|
@ -55,10 +55,12 @@ public class AgentDocTest {
|
|||
Agent<Integer> agent = new Agent<Integer>(5, ec);
|
||||
|
||||
//#send
|
||||
// send a value
|
||||
// send a value, enqueues this change
|
||||
// of the value of the Agent
|
||||
agent.send(7);
|
||||
|
||||
// send a function
|
||||
// send a Mapper, enqueues this change
|
||||
// to the value of the Agent
|
||||
agent.send(new Mapper<Integer, Integer>() {
|
||||
public Integer apply(Integer i) {
|
||||
return i * 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue