summaryrefslogtreecommitdiff
path: root/src/rabbit_channel_sup.erl
diff options
context:
space:
mode:
authorVlad Alexandru Ionescu <vlad@rabbitmq.com>2011-01-20 17:19:07 +0000
committerVlad Alexandru Ionescu <vlad@rabbitmq.com>2011-01-20 17:19:07 +0000
commit1cc1ac6dc8c43a7d6fc6e36abb80cecd3a74414c (patch)
tree98d3c2fe536dfcb1a0064dd15f69c92972b794ea /src/rabbit_channel_sup.erl
parentf8ddf02f3d43445ba57ed290ff5b9f1df2b499b4 (diff)
downloadrabbitmq-server-1cc1ac6dc8c43a7d6fc6e36abb80cecd3a74414c.tar.gz
fixing type specs; other cosmetic
Diffstat (limited to 'src/rabbit_channel_sup.erl')
-rw-r--r--src/rabbit_channel_sup.erl17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rabbit_channel_sup.erl b/src/rabbit_channel_sup.erl
index 3b00181b..d21cfdb7 100644
--- a/src/rabbit_channel_sup.erl
+++ b/src/rabbit_channel_sup.erl
@@ -18,7 +18,7 @@
-behaviour(supervisor2).
--export([start_link/2]).
+-export([start_link/1]).
-export([init/1]).
@@ -31,19 +31,20 @@
-export_type([start_link_args/0]).
-type(start_link_args() ::
- {rabbit_types:protocol(), rabbit_net:socket(),
+ {'tcp', rabbit_types:protocol(), rabbit_net:socket(),
rabbit_channel:channel_number(), non_neg_integer(), pid(),
- rabbit_types:user(), rabbit_types:vhost(), pid()}).
+ rabbit_types:user(), rabbit_types:vhost(), pid()} |
+ {'direct', rabbit_channel:channel_number(), pid(), rabbit_types:user(),
+ rabbit_types:vhost(), pid()}).
--spec(start_link/2 :: (atom(), start_link_args()) ->
- {'ok', pid(), {pid(), any()}}).
+-spec(start_link/1 :: (start_link_args()) -> {'ok', pid(), {pid(), any()}}).
-endif.
%%----------------------------------------------------------------------------
-start_link(tcp, {Protocol, Sock, Channel, FrameMax, ReaderPid, User, VHost,
- Collector}) ->
+start_link({tcp, Protocol, Sock, Channel, FrameMax, ReaderPid, User, VHost,
+ Collector}) ->
{ok, SupPid} = supervisor2:start_link(?MODULE, []),
{ok, WriterPid} =
supervisor2:start_child(
@@ -60,7 +61,7 @@ start_link(tcp, {Protocol, Sock, Channel, FrameMax, ReaderPid, User, VHost,
intrinsic, ?MAX_WAIT, worker, [rabbit_channel]}),
{ok, AState} = rabbit_command_assembler:init(Protocol),
{ok, SupPid, {ChannelPid, AState}};
-start_link(direct, {Channel, ClientChannelPid, User, VHost, Collector}) ->
+start_link({direct, Channel, ClientChannelPid, User, VHost, Collector}) ->
{ok, SupPid} = supervisor2:start_link(?MODULE, []),
{ok, ChannelPid} =
supervisor2:start_child(