-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THRIFT-5446: Added code-gen for rust async. #2426
Conversation
595182f
to
8c821d8
Compare
First off, thank you for starting work on this feature! A couple of high-level thoughts from skimming through the code. I wonder if there's a better way of generalizing the functions than adding an Next, I would like to see a rough cut of how Finally, I've never used |
Thanks!
I have no strong opinions here: the approach here just avoids code duplication by branching of with the
I agree. I have been working on it today. I just pushed a draft to this. Still not compiling, but it gives a general idea; it is just mundane code of the equivalent |
f8219fc
to
b04367a
Compare
Small update: with this version of the code, I was able to generate new code for |
@allengeorge , I have no idea what practices are used here wrt to testing, could you guide me in what you think makes sense to test so that I can cover this accordingly? |
b65909c
to
fd0c24f
Compare
pushed an implementation of the writing and corresponding protocol |
fd0c24f
to
77cdf95
Compare
@jorgecarleitao I'm sorry for letting this linger. The last month has been very tough in terms of getting to work on open-source. I'm gonna try get up to speed as quickly as I can with the async space so that I can properly review this PR. wrt your question. Actually, the thrift project has quite a few test suites:
I'm happy to provide any details I can on any of these test suites |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
How come this has been closed? This seems like a great feature. |
This draft PR adds support to generate the async version for Rust. Note that when it comes to async, Rust is effectively colored, and thus we need both versions.
It introduces:
TInputStreamProtocol
andTOutputStreamProtocol
used to consume the streamTInputStreamProtocol
andTOutputStreamProtocol
for compactI verified that this code generates a valid implementation for
parquet.thrift
, from which a diff can be seen here.NOTE: this PR introduces two dependencies to the rust library,
async-trait
andfutures
.The first is a macro to enable support for traits with
async
(whichTInputStreamProtocol
is).The second is a very common set of traits useful for declaring
async
interfaces without committing to a particular runtime (e.g. tokyo).