aboutsummaryrefslogtreecommitdiffstats
path: root/manual/ranch_protocol.md
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-08-20 14:28:16 +0200
committerLoïc Hoguin <[email protected]>2015-08-20 14:28:16 +0200
commitc867ec582d445b251ff659ba23f522b5278d5119 (patch)
tree50efcb176bc97207ed06a536acd2f7c56db9db98 /manual/ranch_protocol.md
parent32e4ebef2ce16b2b1fce2a4af7bb2bd7ef17f235 (diff)
downloadranch-c867ec582d445b251ff659ba23f522b5278d5119.tar.gz
ranch-c867ec582d445b251ff659ba23f522b5278d5119.tar.bz2
ranch-c867ec582d445b251ff659ba23f522b5278d5119.zip
Add tests and more docs about separate supervisor/connection
Diffstat (limited to 'manual/ranch_protocol.md')
-rw-r--r--manual/ranch_protocol.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/manual/ranch_protocol.md b/manual/ranch_protocol.md
index 3e8b62e..807d20a 100644
--- a/manual/ranch_protocol.md
+++ b/manual/ranch_protocol.md
@@ -12,7 +12,7 @@ None.
Callbacks
---------
-### start_link(Ref, Socket, Transport, ProtoOpts) -> {ok, pid()}
+### start_link(Ref, Socket, Transport, ProtoOpts) -> {ok, pid()} | {ok, pid(), pid()}
> Types:
> * Ref = ranch:ref()
@@ -27,9 +27,16 @@ Callbacks
> then return the new pid. This function will always be called
> from inside a supervisor.
>
+> This callback can also return two pids. The first pid is the
+> pid of the process that will be supervised. The second pid is
+> the pid of the process that will receive ownership of the
+> socket. This second process must be a child of the first. This
+> form is only available when `connection_type` is set to
+> `supervisor`.
+>
> If any other value is returned, the supervisor will close the
> socket and assume no process has been started.
>
-> Do not perform any operation in this callback, as this would
+> Do not perform any operations in this callback, as this would
> block the supervisor responsible for starting connection
> processes and degrade performance severely.