thrift/lib
David Reiss 068f4169b9 cpp: TNonblockingServer: Allow unrun tasks to expire after a time limit
Enhance ThreadManager to allow a expiration time interval to be assigned
to tasks, and expire those tasks after that time limit has passed.
Enhance TNonblockingServer to utilize this capability so it can be used
for overload resilience.

Note: expired entries are only removed from the queue head, so the
mechanism in ThreadManager may not do what you expect if you have
heterogeneous expiration times. That's not an issue with
TNonblockingServer (which will give all tasks the same limit) and might
not be in other cases where most tasks have the same limit and the rest
execute quickly. A full-up timeout queue would be more complex and have
greater overhead than that used here. It's unnecessary for the task at
hand so I didn't go that route...

The TNonblocking interface is simple: a setTaskExpireTime() accepts a
64-bit millisecond argument. 0 means infinite. A getTaskExpireTime()
accessor completes the interface.

The ThreadManager interface involves an added argument to add() for the
expiration interval and a setExpireCallback() function for setting a
callback that is called for expired tasks (for this project this is
necessary to shut down the associated connection).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920673 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:45 +00:00
..
cocoa THRIFT-687. Fix memory leak in TSocketServer. 2010-02-10 01:03:01 +00:00
cpp cpp: TNonblockingServer: Allow unrun tasks to expire after a time limit 2010-03-09 05:19:45 +00:00
csharp THRIFT-622. Add appropriate licensing information to get Thrift ready for a release. 2009-12-07 00:42:38 +00:00
erl THRIFT-622. Add appropriate licensing information to get Thrift ready for a release. 2009-12-07 00:42:38 +00:00
hs THRIFT-560. haskell: Add THttpClient 2010-01-11 19:13:14 +00:00
java THRIFT-661. java: Detect EOF in TIOStreamTransport 2010-03-09 05:19:14 +00:00
js THRIFT-550: Added javascript support 2010-02-15 03:24:55 +00:00
ocaml THRIFT-387. Add appropriate Apache header to all code files 2009-04-08 00:19:37 +00:00
perl THRIFT-619: Perl server and example 2009-11-12 03:01:33 +00:00
php THRIFT-659. php: Make php_thrift_protocol handle std::exception cleanly 2010-03-09 05:19:20 +00:00
py THRIFT-475. python: Eliminate DeprecationWarning 2010-03-09 05:19:18 +00:00
rb THRIFT-720. rb: HTTPClientTransport ignores url parameters 2010-03-02 18:34:00 +00:00
st THRIFT-643. smalltalk: Generated code doesnt load on Squeak3.10.2-7179-basic and PharoCore-1.0-10491rc1 images 2010-01-19 05:18:55 +00:00
Makefile.am THRIFT-387. Add license headers to a bunch of files 2009-03-30 21:35:00 +00:00