thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Craig <ben.cr...@ni.com>
Subject Re: TThreadedServer link error
Date Tue, 10 Dec 2013 17:43:08 GMT
The second method requires you to have both a Thrift client and a Thrift 
server on both sides of the connection.

So in your current implementation, "Alice" has a client, and connects to 
"Bob's" server.

If you wanted Bob to initiate a message, then you can change your 
implementation to something like the following:

Bob creates a Thrift server.
Alice creates a Thrift server.
Alice creates a Thrift client, and connects to Bob.
Alice sends a message containing connection information (e.g. hostname and 
port) to Bob.
Bob takes the connection information, creates a Thrift client, and 
connects to Alice with the provided information.
When Bob notices an event, he sends a message on his Thrift client.


onorato.vaticone@gmail.com wrote on 12/10/2013 11:16:58 AM:

> From: Onorato Vaticone <onorato@onoratovaticone.it>
> To: user@thrift.apache.org, 
> Date: 12/10/2013 11:17 AM
> Subject: Re: TThreadedServer link error
> Sent by: onorato.vaticone@gmail.com
> 
> thanks for your answer ...
> 
> can you say something more on the second method?
> 
> 
> 
> On 10 December 2013 18:02, Ben Craig <ben.craig@ni.com> wrote:
> 
> > Currently, Thrift does not have a way to initiate a messages from the
> > server side.  There are two major ways to fake it though.
> >
> > 1. Have a method on your client interface to poll for events.  Have 
this
> > method's implementation on the server block until a new event arrives,
> > then return the relevant information.
> > 2. Create a second connection, going in the opposite direction.
> >
> > onorato.vaticone@gmail.com wrote on 12/10/2013 10:56:39 AM:
> >
> > > From: Onorato Vaticone <onorato@onoratovaticone.it>
> > > To: user@thrift.apache.org,
> > > Date: 12/10/2013 10:57 AM
> > > Subject: Re: TThreadedServer link error
> > > Sent by: onorato.vaticone@gmail.com
> > >
> > > just noted that the TimerManager mechanism could fit my needs ....
> > > I can on the server side schedule a timer, and that's fine ... but 
how
> > to
> > > notify the client(s) about the event? might I use the callback?
> > >
> > > any idea?
> > >
> > >
> > >
> > > On 10 December 2013 17:31, Onorato Vaticone
> > <onorato@onoratovaticone.it>wrote:
> > >
> > > > Hi guys,
> > > > does thrift has event mechanism?
> > > > would be nice to have the client callback (like in the
> > TNonblockingServer)
> > > > called from the server any time an "event" occurs on the server 
... is
> > > > something available of do I have to emulate it?
> > > >
> > > > TIA
> >
> >
> 
> 
> -- 
> Onorato Vaticone
> m : +39.3336048864
> email : onorato@onoratovaticone.it
> web : www.onoratovaticone.it


Mime
View raw message