Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ actor Public
forked from edescourtis/actor

A java actor library with linked and priority queue support

License

Notifications You must be signed in to change notification settings

uchenm/actor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

actor

A java actor library with linked and priority queue support.

To produce a jar file simply run ant.

package com.benbria.actor;
public class ActorExample {
 public static void main(String[] args) throws InterruptedException {
 Actor<String> actor = ThreadActor.spawn(new Behaviour<String>() {
 @Override
 public boolean receive(Actor<String> self, String msg) {
 System.out.println("Got: " + msg);
 return !msg.equals("stop");
 }
 @Override
 public void exception(Actor<String> self, Exception e) {}
 });
 actor.send("hello");
 actor.send("world");
 Thread.sleep(1000);
 actor.send("stop");
 }
}

Output:

Got: hello
Got: world

License

MIT

About

A java actor library with linked and priority queue support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /