Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2709

c_glib: Support server implementation

    XMLWordPrintableJSON

    Details

    • Patch Info:
      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

          Issue Links

            Activity

              People

              • Assignee:
                simonsouth Simon South
                Reporter:
                simonsouth Simon South
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: