Should it poll if nobody is interested in reading anything?

On Mon, Apr 14, 2014 at 5:15 PM, Filippo De Luca <[email protected]>wrote:

> Hi,
> No one can help or maybe the question is too silly?
> On Apr 12, 2014 10:20 AM, "Filippo De Luca" <[email protected]> wrote:
>
>> Hi,
>> I need to have actors reacting to some events arriving from some kafka
>> topics. I would like leverage on the akka supervisor mechanism to keep the
>> kafka consumer app and running.
>>
>> I know that an actor should never block waiting for some IO, but the
>> kafka consumer is blocking so having an actor running a kafka consumer
>> doesn't seem a good option, also because it will never release the thread.
>>
>> by other hand if I will have a thread, not controlled by akka, to run the
>> kafka consumer, it will not leverage on the akka supervision.
>>
>> My idea is to use an actor, with a dedicated dispatcher, to run the kafka
>> consumer. The problem is: if this actor is blocked by the kafka stream, how
>> can I make this actor reacting to some messages? I am thinking using a
>> timeout on kafka consumer and resent a message like Consume when the
>> timeout is elapsed, so I can consume other messages. It works if the kafka
>> stream doesn't have always data available (in the timeout window), but
>> doesn't work otherwise.
>>
>> Another option may implement a mailbox using kafka.
>>
>> What is the best approach in your opinion? Thanks.
>>
>> --
>> >>>>>>>>>> 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 [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/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 [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/d/optout.
>



-- 
Cheers,
√

-- 
>>>>>>>>>>      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 [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/d/optout.

Reply via email to