Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

More options for thrift #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

More options for thrift #6

wants to merge 6 commits into from

Conversation

aemay2
Copy link
Contributor

@aemay2 aemay2 commented Jun 3, 2015

Added the ability to change the transport and the socket and added a 'dynamic' version of the sample server so that the extra variations can be tested

aemay2 added 2 commits June 3, 2015 17:10
added (potentially redundant) socket selection
end

get '/sockets' do
sockets = {'Thrift::Socket'=>'Thrift::Socket'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other socket implementations? I'd like to understand the motivation for making this configurable.

@brokensandals
Copy link
Contributor

We'll also want to show the transport (and socket, if we keep it) fields in the json representation section of the readme.

@@ -88,7 +101,8 @@ class App < Sinatra::Base
end.compact

begin
transport = Thrift::FramedTransport.new Thrift::Socket.new(invocation['host'], invocation['port'])
socket = Object::const_get(invocation['socket']).new(invocation['host'], invocation['port'])
transport = Object::const_get(invocation['transport']).new(socket)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide defaults for the new fields to keep this passive, i.e. invocation['transport'] || 'Thrift::FramedTransport', because there are some users who post request json that they've saved previously.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants