Comments (4)
Hi. The backend service doesn't support publishing a message to multiple channels simultaneously. It would have to be implemented in the client SDK by looping through the channel list.
from ruby.
Samnang,
Something I did in the past using the Java SDK was to create a publisher worker thread that will publish to a specific channel. Each of those publishers will subscribe to a single master worker thread that will publish the message to those channel specific publishers which will in turn publish the message to their own channels. This is a good design pattern if it needs to be publish to all channels at the same time rather than in sequence.
To be more specific:
- Master worker thread publishes a message on
channel_master
- Channel 1 worker thread subscribes to
channel_master
and publishes message received onchannel1
- Channel 2 worker thread subscribes to
channel_master
and publishes message received onchannel2
... - Channel n worker thread subscribes to
channel_master
and publishes message received onchannelN
Regards
Craig
from ruby.
What I try to build is private messaging between users in social mobile
application. A user can select one or few users to send messages back and
forth between them like Facebook. I'm not a good design pattern yet, but so
far I got whenever a user select one or few users, then we creat a chat in
DB with a list of members, then whenever they send a new message in that
chat, then we publish to all menbers via their private channel. Each user
has their unique private channel. What do you think?
On Tuesday, April 29, 2014, Craig Conover [email protected] wrote:
Samnang,
Something I did in the past using the Java SDK was to create a publisher
worker thread that will publish to a specific channel. Each of those
publishers will subscribe to a single master worker thread that will
publish the message to those channel specific publishers which will in turn
publish the message to their own channels. This is a good design pattern if
it needs to be publish to all channels at the same time rather than in
sequence.
Regards
Craig—
Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-41592932
.
H.P (+855)16 701 721
Website: http://wowkhmer.com
Twitter: http://twitter.com/samnangchhun
LinkedIn: http://www.linkedin.com/in/samnangchhun
from ruby.
@samnang that is a great pattern... feel free to contact us at [email protected], and we're happy to advise you further on implementing PubNub with your app.
geremy
from ruby.
Related Issues (20)
- Publishing message error HOT 7
- Unsubscribe? HOT 4
- Exception inside SubscribeCallback is getting ignored
- presence method does not get a callback on join events HOT 7
- "less than 100ms" HOT 4
- PubNub 3.4 for Ruby Released HOT 3
- Out of date dependency: concurrent-ruby
- Hardcoded log file HOT 4
- uninitialized constant Pubnub::Configuration::PUBNUB_VERSION HOT 8
- This application keeps requesting messages from the database forever HOT 5
- Multi-process access in Heroku environment causes PubNub initialization to occasionally fail HOT 7
- Problems with PAM ttl in 3.5.0beta HOT 2
- 3.5.0 Release Candidate Available
- Logger invocations should use progname HOT 4
- event machine not initialized exception HOT 2
- Message object does allow values to be arrays HOT 3
- MXing with Ruby
- Error on publish "eventmachine not initialized" HOT 19
- Retrieve message uuid from ruby api HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby.