GitHub user adamconnelly opened a pull request:
https://github.com/apache/thrift/pull/762
THRIFT-3510 Add HttpTaskAsyncHandler implementation
The THttpHandler doesn't support an async pipeline. This means that it's
difficult for service implementations to make async calls. I've added an
implementation of HttpTaskAsyncHandler, so you can write services using async
calls.
Additionally, if you generate the C# classes with the current async
support, you get a single interface with both sync and async methods. This
doesn't really make sense on the server side since if you implement a service
you end up leaving all the async method unimplemented. I've added a new option
to the compiler that allows you to generate separate async and sync interfaces:
separateasync.
This generates code like the following:
```csharp
public interface ISync
{
void DoSomething();
}
public interface IAsync
{
Task DoSomethingAsync();
}
public interface Iface : ISync, IAsync
{
}
```
I tried to write the code for the generator in such a way that I didn't
alter the existing functionality. I've probably created a load of duplication
as part of that, but that was just because I'm not familiar with the code.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/adamconnelly/thrift THRIFT-3510
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/762.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #762
----
commit 7174c50c9af988a7843b92717d1e8cb464d2a12a
Author: Adam Connelly <[email protected]>
Date: 2015-12-26T15:55:05Z
THRIFT-3510 Add a HttpTaskAsyncHandler implementation
I've added an implementation of HttpTaskAsyncHandler so that we can do
async processing on the server side of thrift services. I've also added a new
compiler option to generate separate sync and async interfaces - this is so
that you can have both sync and async support in the same project, without
having to implement both sets of interfaces when writing a service.
commit a0d057eb7fd6566e3d6ab7bc8186daab8df4580e
Author: Adam Connelly <[email protected]>
Date: 2015-12-26T15:57:33Z
THRIFT-3510 Adding a test MVC project to illustrate using the sync and
async HTTP handlers
I've added a simple project that has a single web page with links to run a
sync and async copy of the thrift test service. I've tried to cut it down to
just the bare essentials as much as possible.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---