aboutsummaryrefslogtreecommitdiffstats
path: root/manual/ranch_protocol.md
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-11-25 15:02:42 +0100
committerLoïc Hoguin <[email protected]>2013-11-25 15:02:42 +0100
commitd2318c0a286daf51b4fe8afc5c6a232eee71ca72 (patch)
tree30a4e2cfa6f6d63c9068145eb82e9ec77c48ec2b /manual/ranch_protocol.md
parente4b3cf94ea41963fa0d65559e7ebb271bd96ba55 (diff)
downloadranch-d2318c0a286daf51b4fe8afc5c6a232eee71ca72.tar.gz
ranch-d2318c0a286daf51b4fe8afc5c6a232eee71ca72.tar.bz2
ranch-d2318c0a286daf51b4fe8afc5c6a232eee71ca72.zip
Add a manual
This is the manual for what is going to be in 1.0. It includes two things that are not in the code yet: the shutdown option and the accept_ack transport callback.
Diffstat (limited to 'manual/ranch_protocol.md')
-rw-r--r--manual/ranch_protocol.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/manual/ranch_protocol.md b/manual/ranch_protocol.md
new file mode 100644
index 0000000..3e8b62e
--- /dev/null
+++ b/manual/ranch_protocol.md
@@ -0,0 +1,35 @@
+ranch_protocol
+==============
+
+The `ranch_protocol` behaviour defines the interface used
+by Ranch protocols.
+
+Types
+-----
+
+None.
+
+Callbacks
+---------
+
+### start_link(Ref, Socket, Transport, ProtoOpts) -> {ok, pid()}
+
+> Types:
+> * Ref = ranch:ref()
+> * Socket = any()
+> * Transport = module()
+> * ProtoOpts = any()
+>
+> Start a new connection process for the given socket.
+>
+> The only purpose of this callback is to start a process that
+> will handle the socket. It must spawn the process, link and
+> then return the new pid. This function will always be called
+> from inside a 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
+> block the supervisor responsible for starting connection
+> processes and degrade performance severely.