Skip to content

Commit 17c60f6

Browse files
committed
Renamed files in preparation for LFE conversion.
1 parent f5b3ba4 commit 17c60f6

10 files changed

+65
-46
lines changed

.gitignore

+28-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
1+
# MacOS
2+
.DS_Store
3+
4+
# Erlang
15
.eunit
2-
deps
36
*.o
47
*.beam
58
*.plt
69
erl_crash.dump
7-
ebin
8-
rel/example_project
910
.concrete/DEV_MODE
11+
12+
# rebar 2.x
1013
.rebar
11-
erl_crash.dump
12-
.idea
13-
.DS_Store
14-
._*
14+
rel/example_project
15+
ebin/*.beam
16+
deps
17+
18+
# rebar 3
19+
.rebar3
20+
_build/
21+
_checkouts/
22+
rebar.lock
23+
.rebar
24+
rebar/*
25+
.rebar/*
26+
rebar3.crashdump
27+
28+
# Emacs
1529
*~
16-
*.iml
17-
.erlang.mk*
18-
_*
30+
\#*\#
31+
.\#*
32+
/.emacs.desktop
33+
/.emacs.desktop.lock
34+
*.elc
35+
auto-save-list
36+
tramp

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# tcp_client
2-
An Erlang TCP client connections manager.
1+
# tcp-mgr
2+
3+
*An Erlang TCP client connection manager*

src/tcp_client_app.erl renamed to src/tcp-mgr-app.erl

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%%% Main app.
2626
%%% @end
2727
%%%-------------------------------------------------------------------
28-
-module(tcp_client_app).
28+
-module('tcp-mgr-app').
2929

3030
-behaviour(application).
3131

@@ -38,7 +38,7 @@
3838

3939
-spec start(term(), term()) -> {error, term()} | {ok, pid()}.
4040
start(_Type, _Args) ->
41-
tcp_client_sup:start_link().
41+
'tcp-mgr-sup':start_link().
4242

4343
-spec stop(term()) -> ok.
4444
stop(_State) ->

src/tcp_client_socket.erl renamed to src/tcp-mgr-socket.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
%%% @end
88
%%% @see <a href="https://github.com/basho/riak-erlang-client">Riak Erlang Client</a>
99
%%%-------------------------------------------------------------------
10-
-module(tcp_client_socket).
10+
-module('tcp-mgr-socket').
1111

1212
-behaviour(poolboy_worker).
1313
-behaviour(gen_server).

src/tcp_client_sup.erl renamed to src/tcp-mgr-sup.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%%% Supervisor.
2626
%%% @end
2727
%%%-------------------------------------------------------------------
28-
-module(tcp_client_sup).
28+
-module('tcp-mgr-sup').
2929

3030
-behaviour(supervisor).
3131

src/tcp-mgr.app.src

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{application, 'tcp-mgr',
2+
[
3+
{description, "A TCP Client Connections Manager"},
4+
{vsn, "0.1.0"},
5+
{applications,
6+
[
7+
kernel,
8+
stdlib
9+
]
10+
},
11+
{modules, []},
12+
{mod, {'tcp-mgr-app', []}},
13+
{registered, []}
14+
]
15+
}.

src/tcp_client.erl renamed to src/tcp-mgr.erl

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
%%% @copyright (C) 2015, <Carlos Andres Bolaños>, All Rights Reserved.
2424
%%% @doc Main interface.
2525
%%%-------------------------------------------------------------------
26-
-module(tcp_client).
26+
-module('tcp-mgr').
2727

2828
%% API
2929
-export([start_link/4, start_link/5]).
@@ -43,15 +43,15 @@ start_link(PoolName, Size, Address, Port) ->
4343
-spec start_link(
4444
atom(),
4545
pos_integer(),
46-
tcp_client_socket:address(),
47-
tcp_client_socket:portnum(),
48-
tcp_client_socket:client_options()
46+
'tcp-mgr-socket':address(),
47+
'tcp-mgr-socket':portnum(),
48+
'tcp-mgr-socket':client_options()
4949
) -> gen:start_ret().
5050
start_link(PoolName, Size, Address, Port, Options) ->
5151
SizeArgs = [{size, Size},
5252
{max_overflow, 0}],
5353
PoolArgs = [{name, {local, PoolName}},
54-
{worker_module, tcp_client_socket}] ++ SizeArgs,
54+
{worker_module, 'tcp-mgr-socket'}] ++ SizeArgs,
5555
WorkerArgs = [{address, Address},
5656
{port, Port},
5757
{options, Options}],
@@ -64,8 +64,8 @@ sync_send(PoolName, Msg) ->
6464
%% @doc Sends a message on the current connection and waits until server
6565
%% respose arrives. Works as Request/Response.
6666
-spec sync_send(
67-
atom(), tcp_client_socket:message(), timeout()
68-
) -> tcp_client_socket:sync_reply().
67+
atom(), 'tcp-mgr-socket':message(), timeout()
68+
) -> 'tcp-mgr-socket':sync_reply().
6969
sync_send(PoolName, Msg, Timeout) ->
7070
execute(PoolName, {sync_send, [Msg, Timeout]}).
7171

@@ -77,8 +77,8 @@ send(PoolName, Msg) ->
7777
%% with a request id. Works asynchronously, and if the server sends
7878
%% a response back, it is sent directly to the caller process.
7979
-spec send(
80-
atom(), tcp_client_socket:message(), timeout()
81-
) -> tcp_client_socket:reply().
80+
atom(), 'tcp-mgr-socket':message(), timeout()
81+
) -> 'tcp-mgr-socket':reply().
8282
send(PoolName, Msg, Timeout) ->
8383
execute(PoolName, {send, [Msg, Timeout]}).
8484

@@ -91,5 +91,5 @@ execute(PoolName, {Cmd, Args}) ->
9191
poolboy:transaction(
9292
PoolName,
9393
fun(Worker) ->
94-
apply(tcp_client_socket, Cmd, [Worker | Args])
94+
apply('tcp-mgr-socket', Cmd, [Worker | Args])
9595
end).

src/tcp_client.app.src

-15
This file was deleted.

test/tcp_server.erl renamed to test/tcp-server.erl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-module(tcp_server).
1+
-module('tcp-server').
22

33
%% API
44
-export([server/0, callback/1]).
@@ -22,7 +22,7 @@ do_recv(Sock, Bs) ->
2222
end.
2323

2424
callback(Pid) ->
25-
io:format("[~p] Msg 1: ~p~n", [self(), tcp_client_socket:send(Pid, "Hi!")]),
25+
io:format("[~p] Msg 1: ~p~n", [self(), 'tcp-mgr-socket':send(Pid, "Hi!")]),
2626
timer:sleep(2000),
27-
io:format("[~p] Msg 2: ~p~n", [self(), tcp_client_socket:send(Pid, "Hi!")]),
28-
io:format("[~p] Msg 3: ~p~n", [self(), tcp_client_socket:send(Pid, "Hi!")]).
27+
io:format("[~p] Msg 2: ~p~n", [self(), 'tcp-mgr-socket':send(Pid, "Hi!")]),
28+
io:format("[~p] Msg 3: ~p~n", [self(), 'tcp-mgr-socket':send(Pid, "Hi!")]).

test/test.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[
2-
{tcp_client,
2+
{'tcp-mgr',
33
[
44
{pools,
55
[

0 commit comments

Comments
 (0)