Skip to content

More erlang style actor for scala & akka via continuations plugin.

Notifications You must be signed in to change notification settings

iron9light/erla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

erlang code:

    run() ->
      Number = receive
        I when is_integer(I) ->
          I
        S when is_list(S) ->
          {N, _Rest} = string:to_integer(S),
          N
      end,
      io:format("got int: ~p", [Number]),
      Other = receive
        X -> X
      end,
      io:format("got other: ~p", [Other]).

    Pid = spawn(run)

erla code:

    val actor = new Actor with ErlActor {
      def actX() = {
        val number = reactX {
          case i: Int => i
          case s: String => s.toInt
        }
        println("got int: %s" format number)
        val other = reactX {
          case x => x
        }
        println("got other: %s" format other)
      }
    }.start()

erla(akka2 version) code:

    val actor = system.actorOf(Props(new ErlActor {
      def act() = {
        val number = react {
          case i: Int => i
          case s: String => s.toInt
        }
        println("got int: %s" format number)
        val other = react {
          case x => x
        }
        println("got other: %s" format other)
      }
    }))

About

More erlang style actor for scala & akka via continuations plugin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages