By that do you mean that the main() is never returning? If so, then you're
blocking the Actor and wasting an entire thread.
Spawn this off on a dedicated dispatcher instead (see dispatchers and
futures docs).

Yes, this is suppose to run always, and even if it fails, it needs to
restart, which is why I was thinking to assign 1 actor to do this job
forever. (Pardon my understanding since I am very new to Akka and don't
know how to do this properly).
I will read up for how to spawn it on a dedicated dispatcher, but my
question is if it would fail, how would the supervisor know and restart it?

Any ideas?

How would you recommend such a method otherwise?
>
Extract an interface (trait) and in tests provide a NoopImplementation
instance of it.

- Regarding Mocking, I would consider your advice and try to stay away from
it, I need to learn how to use your advice (I am new to this entire
ecosystem)

On Fri, May 29, 2015 at 9:38 AM, Konrad Malawski <kt...@typesafe.com> wrote:

>  def run: Unit = LogReaderDisruptor.main(Array())
>> is a method that is supposed to run forever, plus it required some setup
>> (that is available on client's machine or test environment),
>>
> By that do you mean that the main() is never returning? If so, then you're
> blocking the Actor and wasting an entire thread.
> Spawn this off on a dedicated dispatcher instead (see dispatchers and
> futures docs).
>
>
>> it was not trivial to set it up for Unit Test, which is why I mocked that
>> part out
>>
> The overall technique is very good, I'm just reserved on using mocking
> tools with concurrent code AFAIR this yields suprising results sometimes.
>
> How would you recommend such a method otherwise?
>>
> Extract an interface (trait) and in tests provide a NoopImplementation
> instance of it.
>
> -- Konrad
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/_qV5b2zpx74/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to