Loading...

orbited-users@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [Orbited] Re: Orbited + PHP Tulio Faria Mon Dec 28 19:00:15 2009

Hi,

yes, it is. You send your data to message broker and it will be pushed to
the clients that are subscribed to that channel.

For example, if you send a message to "/stream/room1", every client that had
subscribed to that channel (/stream/room1) will receive the message.

If you want to push data to a specific client, you can create a channel for
that, for example, /stream/room1/user1. So you client subscribe to that
channel and you PHP script sends data to that channel to communicate with
this specific user.

About the StompSender class, you can find that here:
http://code.google.com/p/simplisticstompclient/downloads/list

I really don't like "pooling method". I don't  like the idea of overload the
database with requests even if there is not any new data. I had some bad
experiences with pooling too :D

I think it's better to send any data using Orbited in the same script that
insert into the database.
It's hard to say more because I don't know you problem with a lot of
details.

Cheers!

Tulio Vitor Machado Faria
IWTech Tecnologia - www.iwtech.com.br
[EMAIL PROTECTED]




On Mon, Dec 28, 2009 at 11:58 PM, CodeMaker <[EMAIL PROTECTED]> wrote:

> Thanks for the reply. since I'm totally new to Comet,Orbited and STOMP
> so I may misunderstand the whole idea.
> I may use Orbited as a message broker (MorbidQ). that's it, It's like
> a message queue. Whenever I have new data to send, I have first send
> it to the message broker and then Orbited pushes it to the client.
> Please correct me if I'm wrong.
>
> for the stompsend class, Is It a standard class? Where can I get it?
>
> To accomplish what I want to do, I need to constantly check the
> database. Any idea how to do that? Also, Is It possible to pass data
> from the client to the server? The reason for that, each user has to
> get a specific data because not all users have or get the same data.
> For example, if user x has logged in, I need to notify the server that
> user x is now online so I need to send something special for user x
> like id or something. After that I need to check the database if there
> is anything new to push it to the message broker and then to user x.
>
> I find it kind of complicated because I usually program in PHP only so
> I don't have that knowledge to implement what I want.
>
> Again thanks for the reply and any help.
>
> On Dec 29, 1:14 am, Tulio Faria <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > you can use Orbited as a message broker (MorbidQ) with no problems.
> >
> > I think the better way to do what you want is send any update/data when
> you
> > insert it into the database.
> >
> > For example, I use the class StompSender to send updates to message
> broker:
> > $sender = new StompSender();
> > $sender->send($yourMsg, '/stream/room1');
> >
> > You can call this method to send when after you insert any data to the
> > database. I think it's better and it's the advantage to use Comet against
> > using any pooling method.
> >
> > Cheers,
> >
> > Tulio Vitor Machado Faria
> > IWTech Tecnologia -www.iwtech.com.br
> > [EMAIL PROTECTED]
> >
> > On Mon, Dec 28, 2009 at 3:09 PM, CodeMaker <[EMAIL PROTECTED]>
> wrote:
> > > Basically, I want to check a database constantly in PHP to see if
> > > there is a new data, If there is, I want to send the new data to
> > > Orbited and then to my clients. I think the best way to communicate
> > > with Orbited is through STOMP but I didn't find a clear or a good
> > > tutorial explaining how to connect PHP with Orbited through STOMP.
> >
> > > Would you please guys provide a simple example for the problem
> > > mentioned above?
> >
> > > Thanks a ton in advance
> >
> > > --
> > > You received this message because you are subscribed to the
> > > Orbited discussion group.
> > > To post, send email to
> > >    <[EMAIL PROTECTED]>
> > > To unsubscribe, send email to
> > >    <[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >
> >
> > > For more options, visit
> > >    <http://groups.google.com/group/orbited-users>
> >
> >
>
> --
> You received this message because you are subscribed to the
> Orbited discussion group.
> To post, send email to
>    <[EMAIL PROTECTED]>
> To unsubscribe, send email to
>    <[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >
> For more options, visit
>    <http://groups.google.com/group/orbited-users>
>

-- 
You received this message because you are subscribed to the
Orbited discussion group.
To post, send email to
    <[EMAIL PROTECTED]>
To unsubscribe, send email to
    <[EMAIL PROTECTED]>
For more options, visit
    <http://groups.google.com/group/orbited-users>