Hi Shooali,

11 feb 2014 kl. 21:05 skrev shooali:

> Thanks for the prompt reply.
> 
> I have a way to stop it. Just to clarify things for me:
> Is the first option better then the second?

I don’t know what first and second refer to, but given the information 
available so far I would recommend starting a Thread in preStart and making 
sure that it stops in postStop (or soon thereafter); MyHandler should probably 
send the obtained events as messages to `self` (i.e. to the managing actor).

Regards,

Roland

> 
> Thanks 
> 
> On Tuesday, February 11, 2014 5:50:37 PM UTC+2, Akka Team wrote:
> Hi Shooali,
> 
> if you are given only that interface, then creating your own Thread is 
> probably the best thing to do. Tying it to an Actor only makes sense if you 
> have a way to make that Client loop stop when the actor is shut down (i.e. 
> you can call something in postStop() which will then eventually make that 
> thread terminate).
> 
> Regards,
> 
> Roland
> 
> 
> 
> On Tue, Feb 11, 2014 at 4:32 PM, shooali <[email protected]> wrote:
> Hi,
> 
> I am new to Akka os I apologise in advance if this is too simple.
> 
> I starting to write an application that is supposed to handle incoming events 
> from a 3rd party server. The connection is proprietary and I need to use 
> their library in Java in order to communicate with it. The way it works is 
> that you are supposed to create a new 'Client' object, 'open' connection to 
> the server with params and then call the Client.run(MyHandler) which loops 
> endlessly inside until exit. The 'MyHandler' is extending their abstract 
> class while I'm implementing a 'OnEvent' type of method.
> My question is, how is it best to handle this when using Akka? Should I spawn 
> a new Thread from my main Actor's 'preStart' method that would do all the 
> setup and call the their run method? or should I write my own ActorSystem and 
> do it from there? Maybe a different way?
> 
> Thanks,
> 
> Shooali  
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/groups/opt_out.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to