Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Actors for Squeak Smalltalk
Last updated at 4:19 am UTC on 11 August 2018
The Smalltalk-80 concurrency model is, at heart, threads with mutable shared state plus locks, semaphores, mutexes and so on (More: Squeak Threading Model).

The library adds an Erlang-style Actor model to Squeak.

The following code snippet creates an actor, and invokes one of its methods via synchronous (Promise-based) RPC:

 h := HelloWorldActor spawn.
 (h greet: 'Actor world') wait. 

 "produces 'Hello, Actor world!'"


Actors are concurrent Smalltalk objects.
https://tonyg.github.io/squeak-actors/processes.html#actor-concurrent-smalltalk-objects
Every Actor’s behavior is specified by a distinct behavior object, usually (but not always!) a subclass of ActorBehavior. Because Actor is a subclass of both ActorProcess and Process, it inherits the public interfaces of both.


More: https://tonyg.github.io/squeak-actors/


.....

Tutorials


The easiest way to learn the library is to try it out. There’s no substitute for experimentation in a live image!

The code snippets in the pages cannot be as interactive as the real thing. It can be difficult to get a feel for the system without hands-on experience. Install the system to try it out.

https://tonyg.github.io/squeak-actors/tutorials.html