Re: [akka-user] Using EventStream in non-actor context

2014-07-21 Thread Leon Ma
Nice! Let me try it.

Thanks a lot!

Leon


在 2014年7月18日星期五UTC-7上午4时58分22秒,Konrad Malawski写道:
>
> Hello again,
> yeah, it would be a different stream, so you loose any ordering guarantees.
>
> But how about spinning up an Actor, that will serve as an adapter for your 
> “non actors” to talk with the event stream?
> That would be the cleanest I believe. You could even make it a typed actor 
> ( http://doc.akka.io/docs/akka/2.3.4/scala/typed-actors.html 
>  ),
> so the non-actors won’t even know that they’re talking with an actor.
>
> How does that sound? :-)
>
> -- 
> Konrad 'ktoso' Malawski
> hAkker @ typesafe
> http://akka.io
>

-- 
>>  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.


Re: [akka-user] Using EventStream in non-actor context

2014-07-18 Thread Konrad 'ktoso' Malawski
Hello again,
yeah, it would be a different stream, so you loose any ordering guarantees.

But how about spinning up an Actor, that will serve as an adapter for your “non 
actors” to talk with the event stream?
That would be the cleanest I believe. You could even make it a typed actor ( 
http://doc.akka.io/docs/akka/2.3.4/scala/typed-actors.html ),
so the non-actors won’t even know that they’re talking with an actor.

How does that sound? :-)

-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe
http://akka.io

-- 
>>  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.


Re: [akka-user] Using EventStream in non-actor context

2014-07-18 Thread Leon Ma
I may need my own message and the log messge (error, warn, Info, etc) to 
keep the order.

If I use my own eventStream, (and Logging use it's own eventStream), I'm 
afraid the 2 channel has its own msg sequence, right?



在 2014年7月17日星期四UTC-7上午5时53分37秒,Konrad Malawski写道:
>
> How about using some other EventBus?
> You can create your own buses very easily, like that: 
> http://doc.akka.io/docs/akka/2.3.4/scala/event-bus.html
>
>
> On Thu, Jul 17, 2014 at 2:45 PM, Leon Ma > 
> wrote:
>
>> Hi, 
>>
>> I'd like to use EventStream to send my specific messages and I have my 
>> own logger to consume those messages.
>>
>> In Actor, it's easy to get the EventStream, like 
>> context.system.EventStream
>>
>> But some of my classes are not actor, so how can I get an EventStream ?
>>
>> or in another question: how can I get a ActorSystem?
>>
>> Since I saw in ActorSystemImpl:
>>
>>   val eventStream: EventStream = new EventStream(DebugEventStream)
>>   eventStream.startStdoutLogger(settings)
>>
>>   val log: LoggingAdapter = new BusLogging(eventStream, "ActorSystem(" + 
>> name + ")", this.getClass)
>>
>>
>> Actually, I need the EventStream instance that shared with the 
>> BusLogging, cause my logger will serve both Logging.Info[Warn, Error...] 
>> and my own message.
>>
>> Any suggestions?
>>
>>
>>
>> Thanks
>>
>> Leon
>>
>>  -- 
>> >> 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+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> Konrad 'ktoso' Malawski
> hAkker @ Typesafe
>
> 
>  

-- 
>>  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.


Re: [akka-user] Using EventStream in non-actor context

2014-07-17 Thread Konrad Malawski
How about using some other EventBus?
You can create your own buses very easily, like that:
http://doc.akka.io/docs/akka/2.3.4/scala/event-bus.html


On Thu, Jul 17, 2014 at 2:45 PM, Leon Ma  wrote:

> Hi,
>
> I'd like to use EventStream to send my specific messages and I have my own
> logger to consume those messages.
>
> In Actor, it's easy to get the EventStream, like context.system.EventStream
>
> But some of my classes are not actor, so how can I get an EventStream ?
>
> or in another question: how can I get a ActorSystem?
>
> Since I saw in ActorSystemImpl:
>
>   val eventStream: EventStream = new EventStream(DebugEventStream)
>   eventStream.startStdoutLogger(settings)
>
>   val log: LoggingAdapter = new BusLogging(eventStream, "ActorSystem(" +
> name + ")", this.getClass)
>
>
> Actually, I need the EventStream instance that shared with the BusLogging,
> cause my logger will serve both Logging.Info[Warn, Error...] and my own
> message.
>
> Any suggestions?
>
>
>
> Thanks
>
> Leon
>
>  --
> >> 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.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
hAkker @ Typesafe



-- 
>>  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.


[akka-user] Using EventStream in non-actor context

2014-07-17 Thread Leon Ma
Hi, 

I'd like to use EventStream to send my specific messages and I have my own 
logger to consume those messages.

In Actor, it's easy to get the EventStream, like context.system.EventStream

But some of my classes are not actor, so how can I get an EventStream ?

or in another question: how can I get a ActorSystem?

Since I saw in ActorSystemImpl:

  val eventStream: EventStream = new EventStream(DebugEventStream)
  eventStream.startStdoutLogger(settings)

  val log: LoggingAdapter = new BusLogging(eventStream, "ActorSystem(" + 
name + ")", this.getClass)


Actually, I need the EventStream instance that shared with the BusLogging, 
cause my logger will serve both Logging.Info[Warn, Error...] and my own 
message.

Any suggestions?



Thanks

Leon

-- 
>>  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.