Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.9.1
-
Fedora 20 64-bit on x86_64
-
Patch Available
Description
The attached patches modify the C (GLib) compiler and library to add support for implementing servers.
The changes to the compiler include
- Adding server-generation methods
- generate_service_helpers, which generates a pair of ThriftStruct subclasses for each service method, used to deserialize the method's arguments and serialize its result
- generate_service_handler, which generates an abstract base class for a service's handler implementations
- generate_service_processor, which generates a service's processor class
- Adding helper methods underscores_to_initial_caps and property_type_name which, respectively, convert an underscore-delimited name back to camel case and return the GLib type needed to store a Thrift type as a GObject property
Changes to the library include
- Changing the signature of ThriftProcessor.process so it returns I/O errors to its caller
- Adding the ThriftDispatchProcessor class, ported from the C++ implementation, which subclasses ThriftProcessor and parses an incoming method-call message for dispatch by subclasses
- Adding a peek method to ThriftTransport and corresponding implementations in ThriftSocket, ThriftBufferedTransport and ThriftFramedTransport
- Add ThriftBufferedTransportFactory and ThriftFramedTransportFactory, used by the server to wrap a raw ThriftTransport in the corresponding subtype
- Changing the signature of ThriftServer.server so it returns an error status to its caller, following GLib's conventions
- Changing ThriftSimpleServer.serve so it
- Detects and reports errors encountered during processing
- Uses transports returned by the transport factories instead of the (raw) transport passed in by the caller
- Uses ThriftTransport.peek to detect the end of input
- Returns an error status to its caller
Attachments
Attachments
Issue Links
- is required by
-
THRIFT-976 c_glib tutorial
- Closed
-
THRIFT-2685 c_glib: Include in integration test suite
- Closed
- relates to
-
THRIFT-2592 thrift server using c_glib
- Closed