Author: dreiss
Date: Tue Jun 10 18:03:37 2008
New Revision: 666461

URL: http://svn.apache.org/viewvc?rev=666461&view=rev
Log:
Rename "Connector" to "ProtocolFactory" since that's what it is (response to 
review by eletuchy)

Modified:
    incubator/thrift/trunk/lib/alterl/src/thrift_client.erl
    incubator/thrift/trunk/lib/alterl/src/thrift_socket_transport.erl

Modified: incubator/thrift/trunk/lib/alterl/src/thrift_client.erl
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_client.erl?rev=666461&r1=666460&r2=666461&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_client.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_client.erl Tue Jun 10 18:03:37 
2008
@@ -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}};

Modified: incubator/thrift/trunk/lib/alterl/src/thrift_socket_transport.erl
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_socket_transport.erl?rev=666461&r1=666460&r2=666461&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_socket_transport.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_socket_transport.erl Tue Jun 
10 18:03:37 2008
@@ -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),


Reply via email to