iconara / mikka

JRuby wrapper for Akka
107 stars 14 forks source link

Example with more than 1 actor #2

Closed rb2k closed 13 years ago

rb2k commented 13 years ago

Not really a bug, more of a suggestion.

So far all the examples either "puts" the input or just exit the actor. It would be cool to have an example that shows how you usually pass on the results of one actor.

Cheers, Marc

iconara commented 13 years ago

Sure, I'll see what I can do. So far Mikka has just been something we've used internally. The examples were mostly to test that some basic functionality worked, but more examples wouldn't hurt. If you come up with something you're more than welcome to submit a pull request. If people are interested I guess I should push up a gem to rubygems.org too.

rb2k commented 13 years ago

I definately would add stuff if I had any idea what I was doing :)

I'm still not quite sure how to make two actors communicate efficiently. I assume I have to link them or use the registry in actor a to find actor b.

p.s. a gem would be awesome

iconara commented 13 years ago

Added examples/hello_world.rb It's not much, but it might get you started. One actor getting a message containing a reference to another, then sending that actor a message.

An actor can also create other actors in the pre_start method (see example/supervision1.rb).

rb2k commented 13 years ago

Thanks, "context.reply()" is exactly what I needed to know!