Re: Javascript: gen:nodejs generated code works in the browser
That's a cool feature Peter! I would really like to have a aligned JavaScript and Node.js Thrift implementation. Today, lot of code is duplicated and I think it should be possible to use the same lib for JavaScript and node.js The following essentials are still missing for node.js: Node.js Testsuite => https://issues.apache.org/jira/browse/THRIFT-1134 Node.js Tutorial => https://issues.apache.org/jira/browse/THRIFT-1135 It would be great to see some patches in that area! Regards Roger Quoting Peter Neumark : Hi, I've always through its sort of strange to have separate code generators for node.js and browser environments. Since I'm trying to get the browser to work as a thrift server (responding to requests coming from the webserver), I need to use the node.js code generator. I got a proof of concept working: https://github.com/postlock/thrift-over-socketio Is anybody else interested in converging the browser/node.js javascript libs and code generator as much as possible? Peter This message was sent using IMP, the Internet Messaging Program.
[jira] [Updated] (THRIFT-1233) Remove unused include in generated C++ code
[ https://issues.apache.org/jira/browse/THRIFT-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Diwaker Gupta updated THRIFT-1233: -- Attachment: THRIFT-1233.patch > Remove unused include in generated C++ code > --- > > Key: THRIFT-1233 > URL: https://issues.apache.org/jira/browse/THRIFT-1233 > Project: Thrift > Issue Type: Improvement > Components: C++ - Compiler > Environment: Ubuntu 11.04, latest trunk. >Reporter: Diwaker Gupta >Assignee: Jake Farrell >Priority: Trivial > Attachments: THRIFT-1233.patch > > > When using cob_style with the CPP generator, the compiler adds an include for > TTransportUtils. This include doesn't seem to be used anywhere and creates an > unnecessary dependency. It also complicates compiling Thrift generated code > on other platforms. > Patch available for review here: > https://reviews.apache.org/r/1034/ -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-769) Pluggable Serializers
[ https://issues.apache.org/jira/browse/THRIFT-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Armaan Sarkar updated THRIFT-769: - Attachment: thrift_scheme_update1.patch The last patch left out the new 'schemes'. This one includes them. > Pluggable Serializers > - > > Key: THRIFT-769 > URL: https://issues.apache.org/jira/browse/THRIFT-769 > Project: Thrift > Issue Type: New Feature > Components: Java - Compiler, Java - Library >Reporter: Bryan Duxbury >Assignee: Bryan Duxbury > Labels: gsoc2011, mentor > Attachments: thrift_scheme.patch, thrift_scheme_update1.patch > > > Thrift is already designed to have modular Protocols, which define the > various elements of binary encoding. However, the way that our code is > generated, we're also implicitly defining every protocol to have a > *structure* like that of the Binary protocol. > This has served us well so far with it's simplicity, and other protocols > (like Compact and JSON) have been able to squeeze into this model > successfully, though at a noticeable cost. For instance, Compact protocol has > to keep its own internal state in a stack to know what the last field id we > wrote was so that it can write compact deltas. The JSON protocol is even more > complex, keeping a truly monstrous amount of state around in order to be able > to do the right thing at the right time. All this state tracking comes with > cost, both in complexity and in actual runtime. > I think that there's a solution to this problem - making the serialization > code itself pluggable. That is, rather than there being a single "write" and > "read" method for every protocol, we could let Protocols require a certain > kind of Serializer to interact with them. Binary protocol could use the > "default tagged" serializer, which would look like what we have today. JSON > would probably use a custom one that basically let it write out strings and > nothing else. Compact would also likely use a custom serializer that kept all > the needed state on the system stack, rather than in a user-code stack. Dare > I say it, but it's possible that if we did it right, we could even serialize > Thrift structs with Avro's serialization format! > The upshot of this change would be to make many protocols faster and simpler, > while also allowing us to implement a broader set of protocols that don't fit > with the traditional Thrift-style protocols. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Duxbury closed THRIFT-1237. - Resolution: Fixed Fix Version/s: 0.7 Assignee: Ionel Corneliu Gog Cool, I just committed this. Thanks for the patch! > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog >Assignee: Ionel Corneliu Gog > Fix For: 0.7 > > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1233) Remove unused include in generated C++ code
[ https://issues.apache.org/jira/browse/THRIFT-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064786#comment-13064786 ] Jake Farrell commented on THRIFT-1233: -- Code looks fine, please attach patch for asf inclusion > Remove unused include in generated C++ code > --- > > Key: THRIFT-1233 > URL: https://issues.apache.org/jira/browse/THRIFT-1233 > Project: Thrift > Issue Type: Improvement > Components: C++ - Compiler > Environment: Ubuntu 11.04, latest trunk. >Reporter: Diwaker Gupta >Assignee: Jake Farrell >Priority: Trivial > > When using cob_style with the CPP generator, the compiler adds an include for > TTransportUtils. This include doesn't seem to be used anywhere and creates an > unnecessary dependency. It also complicates compiling Thrift generated code > on other platforms. > Patch available for review here: > https://reviews.apache.org/r/1034/ -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (THRIFT-1233) Remove unused include in generated C++ code
[ https://issues.apache.org/jira/browse/THRIFT-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Diwaker Gupta reassigned THRIFT-1233: - Assignee: Jake Farrell Bump. > Remove unused include in generated C++ code > --- > > Key: THRIFT-1233 > URL: https://issues.apache.org/jira/browse/THRIFT-1233 > Project: Thrift > Issue Type: Improvement > Components: C++ - Compiler > Environment: Ubuntu 11.04, latest trunk. >Reporter: Diwaker Gupta >Assignee: Jake Farrell >Priority: Trivial > > When using cob_style with the CPP generator, the compiler adds an include for > TTransportUtils. This include doesn't seem to be used anywhere and creates an > unnecessary dependency. It also complicates compiling Thrift generated code > on other platforms. > Patch available for review here: > https://reviews.apache.org/r/1034/ -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064780#comment-13064780 ] Ionel Corneliu Gog commented on THRIFT-1237: We had some backward compatibility issues at Facebook, but we will solve them in a different way. I updated the patch so that it only includes the new counters. > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ionel Corneliu Gog updated THRIFT-1237: --- Attachment: (was: add_java_counters.patch) > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ionel Corneliu Gog updated THRIFT-1237: --- Attachment: add_java_counters.patch > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1208) python TCompactProtocol.py writeBool and readBool not follow the compact-proto-spec-2.txt spec for CONTAINER_WRITE, CONTAINER_READ
[ https://issues.apache.org/jira/browse/THRIFT-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064763#comment-13064763 ] Hudson commented on THRIFT-1208: Integrated in Thrift #192 (See [https://builds.apache.org/job/Thrift/192/]) THRIFT-1208. py: Compact protocol always reads and writes booleans as true Patch: liwei bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1146180 Files : * /thrift/trunk/lib/py/src/protocol/TCompactProtocol.py > python TCompactProtocol.py writeBool and readBool not follow the > compact-proto-spec-2.txt spec for CONTAINER_WRITE, CONTAINER_READ > --- > > Key: THRIFT-1208 > URL: https://issues.apache.org/jira/browse/THRIFT-1208 > Project: Thrift > Issue Type: Bug > Components: Python - Library >Affects Versions: 0.6.1 >Reporter: liwei >Assignee: liwei > Fix For: 0.7 > > Attachments: THRIFT-1208.compactproto_readwrite_bool_bug.patch > > > In > https://issues.apache.org/jira/secure/attachment/12399869/compact-proto-spec-2.txt, > define the boolean value as follow: > boolean-true => 0x1 > boolean-false => 0x2 > But in TCompactProtocol.py writeBool, readBool for CONTAINER_WRITE, > CONTAINER_READ just bool(0x2) will always get true. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1225) TCompactProtocol for PHP
[ https://issues.apache.org/jira/browse/THRIFT-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064764#comment-13064764 ] Hudson commented on THRIFT-1225: Integrated in Thrift #192 (See [https://builds.apache.org/job/Thrift/192/]) THRIFT-1225. php: TCompactProtocol for PHP Patch: Dave Watson bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1146185 Files : * /thrift/trunk/lib/php/src/protocol/TCompactProtocol.php > TCompactProtocol for PHP > > > Key: THRIFT-1225 > URL: https://issues.apache.org/jira/browse/THRIFT-1225 > Project: Thrift > Issue Type: Improvement > Components: PHP - Library >Affects Versions: 0.7 >Reporter: Dave Watson >Assignee: Dave Watson > Fix For: 0.7 > > Attachments: thrift-1225.patch > > > A TCompactProtocol implementation for PHP. Similar to the Python version. > Except the I64 stuff. I64 doesn't work on 32bit PHP, it uses two 32bit ints > instead and a bunch of bit fiddling. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1225) TCompactProtocol for PHP
[ https://issues.apache.org/jira/browse/THRIFT-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064750#comment-13064750 ] Dave Watson commented on THRIFT-1225: - Yea at FB our php code lives in a different directory structure, and I added unit tests there. I should update the TestServer/TestClient to accept TCompact though. Thanks! > TCompactProtocol for PHP > > > Key: THRIFT-1225 > URL: https://issues.apache.org/jira/browse/THRIFT-1225 > Project: Thrift > Issue Type: Improvement > Components: PHP - Library >Affects Versions: 0.7 >Reporter: Dave Watson >Assignee: Dave Watson > Fix For: 0.7 > > Attachments: thrift-1225.patch > > > A TCompactProtocol implementation for PHP. Similar to the Python version. > Except the I64 stuff. I64 doesn't work on 32bit PHP, it uses two 32bit ints > instead and a bunch of bit fiddling. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (THRIFT-1225) TCompactProtocol for PHP
[ https://issues.apache.org/jira/browse/THRIFT-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Duxbury closed THRIFT-1225. - Resolution: Fixed Fix Version/s: 0.7 Assignee: Dave Watson I did a very cursory review and this looks faithful. I'd really like to have tests, but we can do those later, I guess. I committed the patch. Thanks Dave! > TCompactProtocol for PHP > > > Key: THRIFT-1225 > URL: https://issues.apache.org/jira/browse/THRIFT-1225 > Project: Thrift > Issue Type: Improvement > Components: PHP - Library >Affects Versions: 0.7 >Reporter: Dave Watson >Assignee: Dave Watson > Fix For: 0.7 > > Attachments: thrift-1225.patch > > > A TCompactProtocol implementation for PHP. Similar to the Python version. > Except the I64 stuff. I64 doesn't work on 32bit PHP, it uses two 32bit ints > instead and a bunch of bit fiddling. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1177) Update thrift to reflect changes in Go's networking libraries
[ https://issues.apache.org/jira/browse/THRIFT-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064746#comment-13064746 ] Hudson commented on THRIFT-1177: Integrated in Thrift #191 (See [https://builds.apache.org/job/Thrift/191/]) THRIFT-1177. go: Update thrift to reflect changes in Go's networking libraries Patch: Aalok Shah bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1146167 Files : * /thrift/trunk/compiler/cpp/src/generate/t_go_generator.cc * /thrift/trunk/lib/go/thrift/ttransport_test.go * /thrift/trunk/lib/go/thrift/ttransport.go * /thrift/trunk/lib/go/thrift/tprotocol_test.go * /thrift/trunk/lib/go/Make.deps * /thrift/trunk/lib/go/thrift/tsocket.go * /thrift/trunk/lib/go/thrift/tnonblocking_socket.go * /thrift/trunk/lib/go/thrift/thttp_client.go * /thrift/trunk/lib/go/thrift/thttp_client_test.go > Update thrift to reflect changes in Go's networking libraries > - > > Key: THRIFT-1177 > URL: https://issues.apache.org/jira/browse/THRIFT-1177 > Project: Thrift > Issue Type: Dependency upgrade > Components: Go - Compiler, Go - Library >Affects Versions: 0.7 >Reporter: Aalok Shah >Assignee: Aalok Shah >Priority: Minor > Fix For: 0.7 > > Attachments: gopatch2-r2.diff, gopatch2.diff > > > Go updated its networking libraries requiring a change to both the thrift > code generator and the libraries. > Additionally, the Go generator did not support arguments/variables that were > Go keywords, this needs to be updated to work with Cassandra's thrift since > "range" is a Go keyword. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (THRIFT-1208) python TCompactProtocol.py writeBool and readBool not follow the compact-proto-spec-2.txt spec for CONTAINER_WRITE, CONTAINER_READ
[ https://issues.apache.org/jira/browse/THRIFT-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Duxbury closed THRIFT-1208. - Resolution: Fixed Fix Version/s: 0.7 Assignee: liwei I just committed this patch. Thanks liwei! > python TCompactProtocol.py writeBool and readBool not follow the > compact-proto-spec-2.txt spec for CONTAINER_WRITE, CONTAINER_READ > --- > > Key: THRIFT-1208 > URL: https://issues.apache.org/jira/browse/THRIFT-1208 > Project: Thrift > Issue Type: Bug > Components: Python - Library >Affects Versions: 0.6.1 >Reporter: liwei >Assignee: liwei > Fix For: 0.7 > > Attachments: THRIFT-1208.compactproto_readwrite_bool_bug.patch > > > In > https://issues.apache.org/jira/secure/attachment/12399869/compact-proto-spec-2.txt, > define the boolean value as follow: > boolean-true => 0x1 > boolean-false => 0x2 > But in TCompactProtocol.py writeBool, readBool for CONTAINER_WRITE, > CONTAINER_READ just bool(0x2) will always get true. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064736#comment-13064736 ] Bryan Duxbury commented on THRIFT-1237: --- I am confused about why you chose to edit the thrift file? Isn't that supposed to be a fundamentally unchanged part of fb303? > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1237) Java fb303 missing some methods
[ https://issues.apache.org/jira/browse/THRIFT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Duxbury updated THRIFT-1237: -- Summary: Java fb303 missing some methods (was: Update ) > Java fb303 missing some methods > --- > > Key: THRIFT-1237 > URL: https://issues.apache.org/jira/browse/THRIFT-1237 > Project: Thrift > Issue Type: Improvement > Components: Java - Library >Affects Versions: 0.7 >Reporter: Ionel Corneliu Gog > Attachments: add_java_counters.patch > > > The java fb303 monitoring interface does not have several methods that are > present in the cpp interface. > I am adding incrementCounter(String key, long increment) and > setCounter(String key, long value). > On top of that I am changing the return of getStatus to an i32 value instead > of the fb_status enum. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (THRIFT-1177) Update thrift to reflect changes in Go's networking libraries
[ https://issues.apache.org/jira/browse/THRIFT-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Duxbury closed THRIFT-1177. - Resolution: Fixed Assignee: Aalok Shah I just committed this. Thanks for the patch, Aalok! > Update thrift to reflect changes in Go's networking libraries > - > > Key: THRIFT-1177 > URL: https://issues.apache.org/jira/browse/THRIFT-1177 > Project: Thrift > Issue Type: Dependency upgrade > Components: Go - Compiler, Go - Library >Affects Versions: 0.7 >Reporter: Aalok Shah >Assignee: Aalok Shah >Priority: Minor > Fix For: 0.7 > > Attachments: gopatch2-r2.diff, gopatch2.diff > > > Go updated its networking libraries requiring a change to both the thrift > code generator and the libraries. > Additionally, the Go generator did not support arguments/variables that were > Go keywords, this needs to be updated to work with Cassandra's thrift since > "range" is a Go keyword. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
Javascript: gen:nodejs generated code works in the browser
Hi, I've always through its sort of strange to have separate code generators for node.js and browser environments. Since I'm trying to get the browser to work as a thrift server (responding to requests coming from the webserver), I need to use the node.js code generator. I got a proof of concept working: https://github.com/postlock/thrift-over-socketio Is anybody else interested in converging the browser/node.js javascript libs and code generator as much as possible? Peter
[jira] [Issue Comment Edited] (THRIFT-1223) AS3 extension - Socket IO, asnychronous calls, callbacks
[ https://issues.apache.org/jira/browse/THRIFT-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064531#comment-13064531 ] Matthias Einwag edited comment on THRIFT-1223 at 7/13/11 1:03 PM: -- No comments up to now on this? I further improved the library a little bit. Added some documentation and error handling. Now an event is sent by the transport in case of an error or client disconnect. In this case also all pending requests are reported as failed to the applications. I also tried to make THttpClient compatible with the new architecture. However did not test it. Anybody interested? One drawback I still see here: If one HTTP request fails *all* pending requests using this transport are reported as failed. Apart from that TFullDuplexHttpClient is still incompatible. was (Author: matthiase): No comments up to now on this? I further improved the library a little bit. Added some documentation and error handling. Now an event is sent by the transport in case of an error or client disconnect. In this case also all pending requests are notified as failed to the applications. I also tried to make THttpClient compatible with the new architecture. However did not test it. Anybody interested? One drawback I still see here: If one HTTP request fails *all* pending requests using this transport are reported as failed. Apart from that TFullDuplexHttpClient is still incompatible. > AS3 extension - Socket IO, asnychronous calls, callbacks > > > Key: THRIFT-1223 > URL: https://issues.apache.org/jira/browse/THRIFT-1223 > Project: Thrift > Issue Type: New Feature > Components: AS3 - Compiler, AS3 - Library >Reporter: Matthias Einwag > Labels: AS3, Async, Compiler, Library > Attachments: as3library.zip, as3library.zip, t_as3_generator.cc, > thrift.zip > > > Hi everyone, > first of all I'm new to Thrift and JIRA, so I hope I can get this right. > I will try to attach my modified version of the AS3 generator and the AS3 > libs. > I did some work on the AS3 implementation of thrift to get TCP/IP socket > support. This includes a new transport TSocket. > Because actionscript supports only non-blocking IO you must use > TFramedTransport, which is also added and wraps around TSocket. > Some example code to create a framed transport: > private var socket:Socket; > private var transport:TIOStreamTransport; > private var framedTransport:TFramedTransport; > socket = new Socket("127.0.0.1",9090); > transport = new TSocket(socket); > transport.open(); > framedTransport = new TFramedTransport(transport); > As I did not like the current asynchronous implementation of Thrift/AS3, I > did some further changes: > - For each service function a send function and a receive function is > generated > - The send function sends the data over the transport and creates an > AsyncResult object (similar to the Deferred in the Py-Twisted > implementation), which stores error and success callback functions as well as > the corresponding receive function. I would also like to add a timeout timer > later to this. > - I now use a processor object for clients and servers. The processor > registers at the transport and is notified when a new Frame was received. > Then process() is called which decodes one message. The processor has a > dictionary that contains the sent requests (TAsyncResult objects). If a > response message is requested the processor calls the recveive function for > the request, which will then lead to a success or error call. This is not > similar to the Java and Py-Twisted implementation where the sequence id and > dictionary is stored in the client. But I find it more useful because I can > support callbacks (see later). > - The generic implementation TProcessor can be used to support client only > functionality. > Example: > protocol = new TBinaryProtocol(framedTransport); > processor = new TProcessor(protocol); > client = new ServiceClient(processor); > TAsyncResult ar = client.send_doSomething(successHandler,errorHandler); > - Derived processors are used for server side functionality and callbacks > Example: > service = new > ServiceProcessor(theComponentThatImplementsTheServiceInterface,protocol); > Now this type of processor can be used to send requests (creating a client as > seen above) and meanwhile will also process incoming requests for the > specified service. > I need to use this for callbacks (events that are sent spontaneously from the > server to the actionscript client) > Missing: > - Improved error handling. At the moment the as3 client does not detect if > the server disconnect, only if it sends a request. > - "Real" server side functionality. Would need a serversocket that creates a > new servicePr
[jira] [Updated] (THRIFT-1223) AS3 extension - Socket IO, asnychronous calls, callbacks
[ https://issues.apache.org/jira/browse/THRIFT-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias Einwag updated THRIFT-1223: Attachment: as3library.zip No comments up to now on this? I further improved the library a little bit. Added some documentation and error handling. Now an event is sent by the transport in case of an error or client disconnect. In this case also all pending requests are notified as failed to the applications. I also tried to make THttpClient compatible with the new architecture. However did not test it. Anybody interested? One drawback I still see here: If one HTTP request fails *all* pending requests using this transport are reported as failed. Apart from that TFullDuplexHttpClient is still incompatible. > AS3 extension - Socket IO, asnychronous calls, callbacks > > > Key: THRIFT-1223 > URL: https://issues.apache.org/jira/browse/THRIFT-1223 > Project: Thrift > Issue Type: New Feature > Components: AS3 - Compiler, AS3 - Library >Reporter: Matthias Einwag > Labels: AS3, Async, Compiler, Library > Attachments: as3library.zip, as3library.zip, t_as3_generator.cc, > thrift.zip > > > Hi everyone, > first of all I'm new to Thrift and JIRA, so I hope I can get this right. > I will try to attach my modified version of the AS3 generator and the AS3 > libs. > I did some work on the AS3 implementation of thrift to get TCP/IP socket > support. This includes a new transport TSocket. > Because actionscript supports only non-blocking IO you must use > TFramedTransport, which is also added and wraps around TSocket. > Some example code to create a framed transport: > private var socket:Socket; > private var transport:TIOStreamTransport; > private var framedTransport:TFramedTransport; > socket = new Socket("127.0.0.1",9090); > transport = new TSocket(socket); > transport.open(); > framedTransport = new TFramedTransport(transport); > As I did not like the current asynchronous implementation of Thrift/AS3, I > did some further changes: > - For each service function a send function and a receive function is > generated > - The send function sends the data over the transport and creates an > AsyncResult object (similar to the Deferred in the Py-Twisted > implementation), which stores error and success callback functions as well as > the corresponding receive function. I would also like to add a timeout timer > later to this. > - I now use a processor object for clients and servers. The processor > registers at the transport and is notified when a new Frame was received. > Then process() is called which decodes one message. The processor has a > dictionary that contains the sent requests (TAsyncResult objects). If a > response message is requested the processor calls the recveive function for > the request, which will then lead to a success or error call. This is not > similar to the Java and Py-Twisted implementation where the sequence id and > dictionary is stored in the client. But I find it more useful because I can > support callbacks (see later). > - The generic implementation TProcessor can be used to support client only > functionality. > Example: > protocol = new TBinaryProtocol(framedTransport); > processor = new TProcessor(protocol); > client = new ServiceClient(processor); > TAsyncResult ar = client.send_doSomething(successHandler,errorHandler); > - Derived processors are used for server side functionality and callbacks > Example: > service = new > ServiceProcessor(theComponentThatImplementsTheServiceInterface,protocol); > Now this type of processor can be used to send requests (creating a client as > seen above) and meanwhile will also process incoming requests for the > specified service. > I need to use this for callbacks (events that are sent spontaneously from the > server to the actionscript client) > Missing: > - Improved error handling. At the moment the as3 client does not detect if > the server disconnect, only if it sends a request. > - "Real" server side functionality. Would need a serversocket that creates a > new serviceProcessor for each client that connects. > - The older HTTP transports are currently not compatible. They have to be > changed to the new processor usage and must send a TMessageReceivedEvent to > the processor. Maybe some minor changes I could add, but I have no time to > test HTTP. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira