Hello Peter,

I’m leaning towards implementing this as Actors actually, but it’s
certainly possible to extend event-buses with what you require.
Just make sure to delegate to super first.

In your case you could reply to it right from the subscribe.
Please remember that a Bus is NOT an Actor, so you’re entering
not-thread-safe-land. You will have to keep your state in an
AtomicReference[T] to be safe etc.
(This on the other hand you would not be forced to do if you implement this
in terms of plain Actors).

override def subscribe(subscriber: Subscriber, to: Classifier): Boolean =
  super.subscribe(subscriber, to) && { subscriber ! "Welcome bob! Last
thing was ${thing.get}"; true }

When extending one of our provided *BusImpl classes (a list is here
http://doc.akka.io/docs/akka/2.3.3/scala/event-bus.html).

I’d still recommend at least trying out to implement as plain Actors, and
if you’re convinced you want the Bus impl, giving it a shot.
In Actors you’re thread safe, and easier to swap out or add mode behavior
later on.
​


On Fri, Jun 20, 2014 at 5:58 PM, Peter Lappo <peter.la...@gmail.com> wrote:

> Was going to use EventBus to publish prices to actors until I realised
> actors arriving at party late don't get to see the last price and have to
> wait for the next one to be published.
>
> Are there any extensions that re-publish the last message to new
> subscribers?
>
> Alternatives
> Roll my own publisher and just use standard akka messages.
> Akka persistence is an over kill as I don't need the transaction log.
>
>  --
> >>>>>>>>>> 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, Inc

<http://scaladays.org>

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