thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilm Schumacher <>
Subject Long running task => step by step response
Date Sat, 03 Jan 2015 13:52:09 GMT

I have a standard set-up like that:
Node1: applicationserver + thriftserver
Node2: webserver + thriftclient

Now I have a long running task (about 2-3) minutes and I want to let the
user know which "step" is completed, as the task can be divided in
reasonable subtasks. But for that the server have to let the client know
about the completed subtasks.

I thought of 2 ways to realize that:

1.) divide the task into the specific subtasks and do 3-4 calls like
"doSubTask1", "doSubTask2" and so on. But for that I would somehow be
able to track the specific tasks (which of course depends on input data).

Something like
string submitTasks(<data>)"
which gives back the id
and then
"doSubTaks1( string id )"

But for that I need to implement an infrastructure to track a task which
would be a lot of work (delete tasks on "timeout" and some things like
that etc. pp.)

2.) making thrift "bidirectional"  by creating special thrift servers on
the client to, and notifiy it for progress. This on the other hand would
need all the infrastructure to make such a bidirectional connection
possible. As there a multiple clients, which can die and reconnect etc.,
I would need a lot of code to create such an possibility.

However, in this way it would be easier to track a long running task, as
it would be
"string doTasks(<data>)"
which gives the ID

and the wait for calls on the "special client server" for events like
"void doneSubTaks1( string id )"

By now I tend to poassibility 2, as it would give me more flexibilty in
the future (infrastructure has to be build only once). Am I wrong? Is
that a bad plan? Do I miss something? Is there a better plan?

Best wishes


View raw message