thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilm Schumacher <wilm.schumac...@gmail.com>
Subject Re: Long running task => step by step response
Date Sat, 03 Jan 2015 19:31:51 GMT
Am 03.01.2015 um 19:46 schrieb Jens Geyer:
> Hi,
>
> I know that polling is evil,
in this case it wouldn't be that evil, as the thrift server and clients
are in a safe network and there are not that much clients. But yeah ...
feels evil :/

> but polling seems to me like The Simplest Thing That Could Possibly
> Work™ here. This is what comes to my mind:
>
> enum status {
>   pending,
>   success,
>   failed
> }
>
> struct actionresult {
>  1 : status  status
>  2:  i32 actionID
> }
>
> service Foobar {
>
>    // this call starts the action
>    // it returns a actionresult struct indicating the initial status
> and/or an actionID
>    actionresult StartSomeTimeConsumingAction( 1: myargs args) throws
> (1 : wtf_error wtf)
>
>    // query status and result of a previously started action
>    actionresult  QueryActionStatus( 1: i32 actionID) throws (1:
> invalid_id_error iex)
> }
seems reasonable as you could seperate the result space by client.

Thanks for the hint,

Wilm




Mime
View raw message