May 2017
Intermediate to advanced
414 pages
13h
English
In the preceding application, we are creating a simple agent whose initial value is 5. You can read the agent value using the get method. We can send a value or function to the agent using the alter function that returns the future. Thus, we can retrieve the result from the future. The first value was 5, then we send the 7 to the agent, it updated the result to 7; thereafter, we send a function to the agent that increments the current value by 3, and we got 10.
After you run the preceding application, its output will be as follows:
Result is now 5 Result after sending a value 7 Result after sending a function 10
Read now
Unlock full access