2

I have a Java implementation of Akka Actor as shown below:

public class Rule1Actor extends UntypedActor{
   @Override 
   public void onReceive(Object message){
   ......
   }  
}

I need to call some python script within the onReceive method. I wanted the python code to be an actor again. In that case, it would be implemented using Pykka.

If so, how would I tell/ask between this Java-actor and Pykka-actor?

bananas
  • 1,176
  • 2
  • 19
  • 39
Kavitha Madhavaraj
  • 562
  • 1
  • 6
  • 23
  • Could you include some tag in your message to say what language you are using? – OneCricketeer May 23 '16 at 11:58
  • I'm afraid you cannot do that by using Akka remoting, there's no remoting in Pykka: https://github.com/jodal/pykka#what-pykka-is-not. Running a python script from java code (http://stackoverflow.com/questions/16447410/how-to-execute-python-script-from-java) would not be the same as tell/ask between actors. – gmaslowski May 23 '16 at 12:02
  • Thats not what I meant. I meant in Akka, it's like a messaging system, no? and your message can be anything, so include some flag or identifer in the message to say "hey, I want python stuff for this message" – OneCricketeer May 23 '16 at 12:05
  • @cricket_007 Sorry. I'm a beginner, a small example would be great help ! Thanks – Kavitha Madhavaraj May 23 '16 at 12:08
  • @gmaslowski Basically one of my Actor needs to execute some DataAnalysis code implemented in Python. Currently this python code is not an Actor. If I made it to actor, then it seems that there is no ideal way to talk between actors written in different languages (Java - Python). Is it a good approach to run python script using Runtime etc within actor, performance wise? How far, the fault tolerance would be taken care for the python code? – Kavitha Madhavaraj May 23 '16 at 12:14
  • @KavithaMadhavaraj it's not easy to answer that because it would depend on many aspects like performance, data volume, development costs and so on.. – gmaslowski May 23 '16 at 12:21
  • may be use some MQ(amqp etc.) in between? – Sergey Benner Jul 13 '18 at 15:44

0 Answers0