Multiple Broadcaster in one AtmosphereHandler

3 messages Options
Embed this post
Permalink
Cagatay Civici

Multiple Broadcaster in one AtmosphereHandler

Reply Threaded More More options
Print post
Permalink
Hi,

I'm using one AtmosphereHandler in core and need different broadcasters to publish data to different subsets of suspended requests.

I've checked out API and Docs, it seems to be possible but can't figure out how, any pointers is appreciated.

Regards,

Cagatay


Jeanfrancois Arcand

Re: Multiple Broadcaster in one AtmosphereHandler

Reply Threaded More More options
Print post
Permalink
Salut,

Cagatay Civici wrote:
> Hi,
>
> I'm using one AtmosphereHandler in core and need different broadcasters
> to publish data to different subsets of suspended requests.
>
> I've checked out API and Docs, it seems to be possible but can't figure
> out how, any pointers is appreciated.

I admit that API needs is not trivial. I hope to improve it with 0.5.
Right now as you noted we have this Broadcaster API:

    * public BroadcasterFuture<Object> broadcast(Object msg,
Set<AtmosphereResource> subset) {

Do in your AtmosphereHandler, you have to either keeps reference to the
AtmosphereResource included in your Set, or you can get from the
Broadcaster itself the entire Set of AtmosphereResource:

   * Iterator<AtmosphereResource> getAtmosphereResources()

and then construct your subset based on the returned value.

I agree that's far from optional and we should think about improving
that API.

Hope that help.

--Jeanfrancois

>
> Regards,
>
> Cagatay
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Cagatay Civici

Re: Multiple Broadcaster in one AtmosphereHandler

Reply Threaded More More options
Print post
Permalink
Thanks for the feedback,

Cagatay

On Nov 6, 2009, at 3:10 PM, Jeanfrancois Arcand wrote:

> Salut,
>
> Cagatay Civici wrote:
>> Hi,
>> I'm using one AtmosphereHandler in core and need different  
>> broadcasters to publish data to different subsets of suspended  
>> requests.
>> I've checked out API and Docs, it seems to be possible but can't  
>> figure out how, any pointers is appreciated.
>
> I admit that API needs is not trivial. I hope to improve it with  
> 0.5. Right now as you noted we have this Broadcaster API:
>
>   * public BroadcasterFuture<Object> broadcast(Object msg,  
> Set<AtmosphereResource> subset) {
>
> Do in your AtmosphereHandler, you have to either keeps reference to  
> the AtmosphereResource included in your Set, or you can get from the  
> Broadcaster itself the entire Set of AtmosphereResource:
>
>  * Iterator<AtmosphereResource> getAtmosphereResources()
>
> and then construct your subset based on the returned value.
>
> I agree that's far from optional and we should think about improving  
> that API.
>
> Hope that help.
>
> --Jeanfrancois
>
>> Regards,
>> Cagatay
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]