thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Meyer <joel.me...@gmail.com>
Subject Re: How to send a message from Thrift server to client?
Date Tue, 26 Oct 2010 18:01:05 GMT
If you're using Java I wrote up an example on how to do this a year and a
half ago (which means some of the thrift constructs may have changed since
then...):
http://joelpm.com/2009/04/03/thrift-bidirectional-async-rpc.html

Code is on github, though it won't easily compile due to lack of maven repo
for thrift:
http://github.com/JoelPM/BidiThrift

IMHO, it's a more elegant approach than long-polling (comet) or starting a
server in your client, but requires you to give up synchronous RPC and move
to something that looks like strongly-typed message passing.

Joel

On Mon, Oct 25, 2010 at 9:45 PM, Mark Slee <mslee@facebook.com> wrote:

> This came up on the thrift-dev@ list just earlier today. Re-pasting my
> reply since the web archives don't seem to have a thread permalink view.
>
> -----
>
> Thrift doesn't support arbitrary message broadcasting. There aren't really
> any elegant solutions for this. The two closest options available are:
>
> (1) Make your clients also be servers, use the "oneway" modifier to have
> the server connect to client and send an RPC for which there is no reply
>
> (2) Use a COMET-style hanging request from the client to server with a long
> timeout -- this is going to be a mess and require nasty server-side
> threading
>
> Neither of these are going to be particularly fun to implement. The Thrift
> server implementations and network protocol are designed assuming that
> clients initiate requests to servers, and servers only speak in direct
> response to client messages.
>
>
> -----Original Message-----
> From: Gyu [mailto:lazygyu@gmail.com]
> Sent: Monday, October 25, 2010 8:20 PM
> To: thrift-user@incubator.apache.org
> Subject: How to send a message from Thrift server to client?
>
> I want to know how to send a message from Thrift server to client.
>
> I've searching for the way from so many web sites. But there is no way to
> that.
>
> What I want to make is..
>
> 1.      An event happened in the server.
> 2.      Then the server send an event message to a client.
> 3.      Finally, client receive that message and display that.
>
> Of course, other ways(like to use pooling in AJAX) I can do I know. But
> it’s not
> in real time.
> I really sick with this problem. Please help me~ T_T
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message