Hi,

On 2 December 2010 15:14, Jim Easterbrook <jim.easterbr...@bbc.co.uk> wrote:
> How practical would it be to add a 'notification' service to the
> backplane component? What I want is for a component of mine to be woken
> up when a subscriber is added or removed, e.g. to stop doing any work
> when the backplane has no subscribers.

What sort of interface would you want ? Something like this?

Pipeline(
    Backplane("MYBACKPLANE"),
    MyComponentThatGetsNotificationsWhenNewClients(),
)

That in itself leads rather naturally to:

Pipeline(
    SendNotificationsToBackplane(),
    Backplane("MYBACKPLANE"),
    MyComponentThatGetsNotificationsWhenNewClients(),
)

Or:

Pipeline(
    Backplane("MYBACKPLANE"),
    BackplaneMonitor(),
    circular = True,
)

(Which would enable BackplaneMonitor to shutdown the Backplane)

This could also lead to the rather recursive:

Pipeline(
    SubscribeTo("UpdateBackplane"),
    Backplane("MYBACKPLANE"),
    PublishTo("ThingsMyBackplanDidToday"),
)

Adding a notification service like this would certainly be doable, so
if you had an API in mind, I'd be curious.

> At the moment I'm sending a message to my component whenever I add a
> subscriber, and using a timer loop to look at the backplane's splitter's
> outboxsinks count every 5 seconds to see if it's dropped to zero. There
> has to be a better way than this.

You could have a notification of:
    * New subscriber
    * New publisher
    * Back to zero subscribers
    * Back to zero publishers

(Publishers are actually harder, but should be doable safely now given
the existence of the STM code)

I'm not sure what notifications you might want to send to the
backplane itself though either. (suggestions/comments welcome)


Michael.

-- 
You received this message because you are subscribed to the Google Groups 
"kamaelia" group.
To post to this group, send email to kamae...@googlegroups.com.
To unsubscribe from this group, send email to 
kamaelia+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/kamaelia?hl=en.

Reply via email to