You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alex (JIRA)" <ji...@apache.org> on 2011/03/31 01:05:05 UTC

[jira] [Created] (THRIFT-1125) Multiplexing support for the Ruby Library

Multiplexing support for the Ruby Library
-----------------------------------------

                 Key: THRIFT-1125
                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
             Project: Thrift
          Issue Type: New Feature
          Components: Ruby - Library
    Affects Versions: 0.6
            Reporter: Alex
            Priority: Minor


Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.

On the server side:
mp = Thrift::MultiplexedProcessor.new
mp.register 'SomeService',  some_service_processor
mp.register 'SomeOtherService', some_other_service_processor
...
server = Thrift::SimpleServer.new(mp, transport)

On the client side:
some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)

You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1125) Multiplexing support for the Ruby Library

Posted by "Alex (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex updated THRIFT-1125:
-------------------------

    Attachment:     (was: multiplexed_processor.rb)

> Multiplexing support for the Ruby Library
> -----------------------------------------
>
>                 Key: THRIFT-1125
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Ruby - Library
>    Affects Versions: 0.6
>            Reporter: Alex
>            Priority: Minor
>              Labels: multiplexing
>         Attachments: multiplexing_support.diff
>
>
> Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.
> On the server side:
> mp = Thrift::MultiplexedProcessor.new
> mp.register 'SomeService',  some_service_processor
> mp.register 'SomeOtherService', some_other_service_processor
> ...
> server = Thrift::SimpleServer.new(mp, transport)
> On the client side:
> some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
> some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)
> You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1125) Multiplexing support for the Ruby Library

Posted by "Alex (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex updated THRIFT-1125:
-------------------------

    Attachment: multiplexing_support.diff

Patch against revision 1087675.

> Multiplexing support for the Ruby Library
> -----------------------------------------
>
>                 Key: THRIFT-1125
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Ruby - Library
>    Affects Versions: 0.6
>            Reporter: Alex
>            Priority: Minor
>              Labels: multiplexing
>         Attachments: multiplexing_support.diff
>
>
> Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.
> On the server side:
> mp = Thrift::MultiplexedProcessor.new
> mp.register 'SomeService',  some_service_processor
> mp.register 'SomeOtherService', some_other_service_processor
> ...
> server = Thrift::SimpleServer.new(mp, transport)
> On the client side:
> some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
> some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)
> You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1125) Multiplexing support for the Ruby Library

Posted by "Alex (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex updated THRIFT-1125:
-------------------------

    Attachment: multiplexed_client.rb
                multiplexed_processor.rb

> Multiplexing support for the Ruby Library
> -----------------------------------------
>
>                 Key: THRIFT-1125
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Ruby - Library
>    Affects Versions: 0.6
>            Reporter: Alex
>            Priority: Minor
>              Labels: multiplexing
>         Attachments: multiplexed_client.rb, multiplexed_processor.rb
>
>
> Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.
> On the server side:
> mp = Thrift::MultiplexedProcessor.new
> mp.register 'SomeService',  some_service_processor
> mp.register 'SomeOtherService', some_other_service_processor
> ...
> server = Thrift::SimpleServer.new(mp, transport)
> On the client side:
> some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
> some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)
> You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1125) Multiplexing support for the Ruby Library

Posted by "Alex (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex updated THRIFT-1125:
-------------------------

    Attachment:     (was: multiplexed_client.rb)

> Multiplexing support for the Ruby Library
> -----------------------------------------
>
>                 Key: THRIFT-1125
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Ruby - Library
>    Affects Versions: 0.6
>            Reporter: Alex
>            Priority: Minor
>              Labels: multiplexing
>         Attachments: multiplexing_support.diff
>
>
> Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.
> On the server side:
> mp = Thrift::MultiplexedProcessor.new
> mp.register 'SomeService',  some_service_processor
> mp.register 'SomeOtherService', some_other_service_processor
> ...
> server = Thrift::SimpleServer.new(mp, transport)
> On the client side:
> some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
> some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)
> You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1125) Multiplexing support for the Ruby Library

Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014089#comment-13014089 ] 

Michael Stockton commented on THRIFT-1125:
------------------------------------------

Alex,

Can you submit a patch instead? The class "Thrift::Client" in multiplexed_client.rb will conflict with "Thrift::Client" in thrift/client.rb. You can alias the initialize method in a subclass to store a service instance instead of copying code from thrift/client.rb. 

The concept of multiplexing has come up before but I'm not aware if we've come to any consensus. I think what you're proposing is to encode a service name in the serialized method name (e.g. "FooService:bar_method") and splitting the string and doing a service lookup. I doubt committers will be a fan of this -- you may want to work on convincing them. Worst case, if it works for you but not for every language supported by thrift, you might have to maintain your own branch.

Michael

> Multiplexing support for the Ruby Library
> -----------------------------------------
>
>                 Key: THRIFT-1125
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1125
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Ruby - Library
>    Affects Versions: 0.6
>            Reporter: Alex
>            Priority: Minor
>              Labels: multiplexing
>         Attachments: multiplexed_client.rb, multiplexed_processor.rb
>
>
> Attached are two files which implement multiplexing support in the Ruby library. I do not consider these implementations complete, however they work well for my purposes.
> On the server side:
> mp = Thrift::MultiplexedProcessor.new
> mp.register 'SomeService',  some_service_processor
> mp.register 'SomeOtherService', some_other_service_processor
> ...
> server = Thrift::SimpleServer.new(mp, transport)
> On the client side:
> some_service = SomeServiceService::Client.new('SomeService', some_service_protocol)
> some_other_service = SomeOtherServiceService::Client.new('SomeOtherService', some_other_service_protocol)
> You only need one transport in both cases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira