Discussion:
[jruby-user] Scala/Akka and JRuby
Alexander Fitterling
2014-10-01 15:01:17 UTC
Permalink
Hi everyone,

is there anyone that uses akka/scala together with jruby?

kind regards,
Alex


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Mike Luu
2014-10-01 16:43:19 UTC
Permalink
I am using Akka actors to process a data stream from Kafka. Similar to a traditional ETL approach except with parallel processing branches.
It’s been good so far. Took a bit to fully embrace the ‘let it fail’ design mentality.

I started with the Mikka gem here:
https://github.com/iconara/mikka

and I created a fork to add enhancements I needed along the way
https://github.com/munkyboy/mikka

Cheers,
Mike
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
kind regards,
Alex
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Alexander Fitterling
2014-10-05 12:04:05 UTC
Permalink
Mike,
thank you.
Am I able to run a parent actor on jruby and implement all child actors in scala? so as they still would share the same environment?
Secondly: I was seeking informations on how to run scala code at all from jruby. Couldn't find something. Are there any hints?
kind regards,
Alex
Post by Mike Luu
I am using Akka actors to process a data stream from Kafka. Similar to a traditional ETL approach except with parallel processing branches.
It’s been good so far. Took a bit to fully embrace the ‘let it fail’ design mentality.
https://github.com/iconara/mikka
and I created a fork to add enhancements I needed along the way
https://github.com/munkyboy/mikka
Cheers,
Mike
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
kind regards,
Alex
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
snacktime
2014-10-05 20:38:54 UTC
Permalink
Yes you can have jruby parent actors that have scala or java children and
visa versa.

Scala classes compile to java bytecode. You access scala classes just like
java classes for the most part. Here is some info from the jruby docs on
the subject.

https://github.com/jruby/jruby/wiki/Integrating-with-Scala



On Sun, Oct 5, 2014 at 5:04 AM, Alexander Fitterling <
Post by Alexander Fitterling
Mike,
thank you.
Am I able to run a parent actor on jruby and implement all child actors in
scala? so as they still would share the same environment?
Secondly: I was seeking informations on how to run scala code at all from
jruby. Couldn't find something. Are there any hints?
kind regards,
Alex
I am using Akka actors to process a data stream from Kafka. Similar to a
traditional ETL approach except with parallel processing branches.
It’s been good so far. Took a bit to fully embrace the ‘let it fail’
design mentality.
https://github.com/iconara/mikka
and I created a fork to add enhancements I needed along the way
https://github.com/munkyboy/mikka
Cheers,
Mike
Hi everyone,
is there anyone that uses akka/scala together with jruby?
kind regards,
Alex
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Alexander Fitterling
2014-10-06 15:33:22 UTC
Permalink
Mike, it works. Do you know if I can use akkas microkernel as well?
kind regards,
Alex
Yes you can have jruby parent actors that have scala or java children and visa versa.
Scala classes compile to java bytecode. You access scala classes just like java classes for the most part. Here is some info from the jruby docs on the subject.
https://github.com/jruby/jruby/wiki/Integrating-with-Scala
Mike,
thank you.
Am I able to run a parent actor on jruby and implement all child actors in scala? so as they still would share the same environment?
Secondly: I was seeking informations on how to run scala code at all from jruby. Couldn't find something. Are there any hints?
kind regards,
Alex
Post by Mike Luu
I am using Akka actors to process a data stream from Kafka. Similar to a traditional ETL approach except with parallel processing branches.
It’s been good so far. Took a bit to fully embrace the ‘let it fail’ design mentality.
https://github.com/iconara/mikka
and I created a fork to add enhancements I needed along the way
https://github.com/munkyboy/mikka
Cheers,
Mike
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
kind regards,
Alex
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Mike Luu
2014-10-06 17:19:10 UTC
Permalink
I haven’t tried it myself. However, it seems all you would need to do is implement the Bootable interface.
http://doc.akka.io/japi/akka/2.2.4/index.html?akka/kernel/Bootable.html

Cheers,
Mike
Post by Alexander Fitterling
Mike, it works. Do you know if I can use akkas microkernel as well?
kind regards,
Alex
Yes you can have jruby parent actors that have scala or java children and visa versa.
Scala classes compile to java bytecode. You access scala classes just like java classes for the most part. Here is some info from the jruby docs on the subject.
https://github.com/jruby/jruby/wiki/Integrating-with-Scala
Mike,
thank you.
Am I able to run a parent actor on jruby and implement all child actors in scala? so as they still would share the same environment?
Secondly: I was seeking informations on how to run scala code at all from jruby. Couldn't find something. Are there any hints?
kind regards,
Alex
Post by Mike Luu
I am using Akka actors to process a data stream from Kafka. Similar to a traditional ETL approach except with parallel processing branches.
It’s been good so far. Took a bit to fully embrace the ‘let it fail’ design mentality.
https://github.com/iconara/mikka
and I created a fork to add enhancements I needed along the way
https://github.com/munkyboy/mikka
Cheers,
Mike
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
kind regards,
Alex
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
R. Tyler Croy
2014-10-01 16:49:37 UTC
Permalink
(replies inline)
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
While not using Akka directly, The concurrent-ruby gem is well supported on
JRuby and provides lots of the same concepts that Akka and Scala have:
<https://github.com/ruby-concurrency/concurrent-ruby>

- R. Tyler Croy

------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>

% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
snacktime
2014-10-05 06:03:27 UTC
Permalink
I use Akka extensively with jruby in
https://github.com/gamemachine/gamemachine.

It pretty much just works. Only one thing I can think of that might throw
someone is that Akka now requires a factory for creating actors. So you
have to jump through a couple of hoops to make that work when your factory
is ruby and your actors are ruby classes that inherit from UntypedActor.

My abstraction layer for actors is in server/lib/game_machine/actor.

If you look at builder.rb and factory.rb, and also in the java class
ActorFactory, you should see how it all fits together. Basically I have a
java factory that is just a proxy to my ruby factory, and a java interface
to make it possible for java to call the create method on my ruby factory
instance.

Only reason I haven't broken out the actor abstractions into a separate gem
is I just haven't had people asking for it, but my project is fairly niche
and not really targeted at what most people use jruby for, so I'm unsure
how much of a demand there really is.

Chris
Post by R. Tyler Croy
(replies inline)
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
While not using Akka directly, The concurrent-ruby gem is well supported on
<https://github.com/ruby-concurrency/concurrent-ruby>
- R. Tyler Croy
------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>
% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
Alexander Fitterling
2014-10-05 12:01:49 UTC
Permalink
ic, thank you indeed.
kind regards,
Alex
Post by R. Tyler Croy
(replies inline)
Post by Alexander Fitterling
Hi everyone,
is there anyone that uses akka/scala together with jruby?
While not using Akka directly, The concurrent-ruby gem is well supported on
<https://github.com/ruby-concurrency/concurrent-ruby>
- R. Tyler Croy
------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>
% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
Loading...