Rename "Connector" to "ProtocolFactory" since that's what it is (response to review by eletuchy)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666461 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/alterl/src/thrift_client.erl b/lib/alterl/src/thrift_client.erl
index a2cc56b..bd93e29 100644
--- a/lib/alterl/src/thrift_client.erl
+++ b/lib/alterl/src/thrift_client.erl
@@ -35,15 +35,15 @@
%% Backwards-compatible starter for the usual case of socket transports
start_link(Host, Port, Service, Options)
when is_integer(Port), is_atom(Service), is_list(Options) ->
- {ok, Connector} = thrift_socket_transport:new_connector(Host, Port, Options),
- start_link(Connector, Service).
+ {ok, ProtocolFactory} = thrift_socket_transport:new_protocol_factory(Host, Port, Options),
+ start_link(ProtocolFactory, Service).
-%% Connector :: fun() -> thrift_protocol()
-start_link(Connector, Service)
- when is_function(Connector), is_atom(Service) ->
+%% ProtocolFactory :: fun() -> thrift_protocol()
+start_link(ProtocolFactory, Service)
+ when is_function(ProtocolFactory), is_atom(Service) ->
case gen_server:start_link(?MODULE, [Service], []) of
{ok, Pid} ->
- case gen_server:call(Pid, {connect, Connector}) of
+ case gen_server:call(Pid, {connect, ProtocolFactory}) of
ok ->
{ok, Pid};
Error ->
@@ -87,9 +87,9 @@
%% {stop, Reason, State}
%% Description: Handling call messages
%%--------------------------------------------------------------------
-handle_call({connect, Connector}, _From,
+handle_call({connect, ProtocolFactory}, _From,
State = #state{service = Service}) ->
- case Connector() of
+ case ProtocolFactory() of
{ok, Protocol} ->
{reply, ok, State#state{protocol = Protocol,
seqid = 0}};
diff --git a/lib/alterl/src/thrift_socket_transport.erl b/lib/alterl/src/thrift_socket_transport.erl
index bdae28b..0c65a22 100644
--- a/lib/alterl/src/thrift_socket_transport.erl
+++ b/lib/alterl/src/thrift_socket_transport.erl
@@ -6,7 +6,7 @@
new/2,
write/2, read/2, flush/1, close/1,
- new_connector/3]).
+ new_protocol_factory/3]).
-record(data, {socket,
recv_timeout=infinity}).
@@ -47,14 +47,14 @@
gen_tcp:close(Socket).
-%%%% CONNECTOR GENERATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% FACTORY GENERATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
-%% Generates a "connector" function - a fun which returns a Protocol instance.
+%% Generates a "protocol factory" function - a fun which returns a Protocol instance.
%% This can be passed to thrift_client:start_link in order to connect to a
%% server over a socket.
%%
-new_connector(Host, Port, Options) ->
+new_protocol_factory(Host, Port, Options) ->
ConnectTimeout = proplists:get_value(connect_timeout, Options, infinity),
InSockOpts = proplists:get_value(sockopts, Options, []),
Framed = proplists:get_value(framed, Options, false),