GithubHelp home page GithubHelp logo

mikka's Introduction

Mikka

Mikka is a thin Ruby wrapper around Akka. It makes Akka's Java API more pleasing to the Rubyist's eye.

Examples

Here's a quick example:

# first you need an ActorSystem, it contains configuration and coordinates actors
actor_system = Mikka.create_actor_system('systam')

# actors are created by the ActorSystem from an instance of Props, which is
# a container for actor configuration properties -- here we assume there
# exists a class called SomeActor
actor = actor_system.actor_of(Mikka::Props[SomeActor], 'Sigourney Weaver')

# send a message to an actor using the shovel operator, which is an alias for #tell
actor << :hello

# when you're done you can shut down your actor system, and wait for it to 
# complete the shutdown process -- don't do this too early, this won't wait
# for your actors to complete processing of their mailboxes, it will just 
# tell them to stop
actor_system.shutdown
actor_system.await_termination

that's how you create and communicate with an actor, here's how you create an actor class:

class SomeActor < Mikka::Actor
  def receive(message)
    # do the thing
  end
end

that's the basics. v2.0 of Mikka is a work in progress, and there will hopefully be more examples in the future. Mikka is a thin wrapper and you should be able to do everything with it that you can with Akka's Java API. It's not always pretty in Ruby, but it kind of works. Mikka's job is to make it pretty.

If you make something that can serve as a useful illustration of some concept, please contribute by sending a patch.

Requirements

Tested in JRuby 1.6.7+ and Ruby 1.9 mode (run with jruby --1.9 or set JRUBY_OPTS='--1.9).

The required Akka and Scala JARs are loaded from the akka-actor-jars and scala-library-jars wrapper gems.

Installation

gem install mikka

Contributors

Theo Hultberg, @iconara Daniel Gaiottino, @bantai

License

Mikka is licensed under the Apache 2 license, the same as Akka. See http://doc.akka.io/docs/akka/2.0/project/licenses.html

Mikka?

Mikka is a glacier close to the Akka massive.

mikka's People

Contributors

iconara avatar akira avatar gaiottino avatar parndt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.