From e381ccccdff196ded3624162bc106aff09885e60 Mon Sep 17 00:00:00 2001 From: "j.uhlig" Date: Thu, 10 May 2018 13:04:57 +0200 Subject: Add a function to wait for number of connections LH: Reworked validation style and added a -dialyzer attribute to acceptor_SUITE to silence expected errors. --- doc/src/manual/ranch.asciidoc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/src/manual/ranch.asciidoc b/doc/src/manual/ranch.asciidoc index b442f88..7fd18d0 100644 --- a/doc/src/manual/ranch.asciidoc +++ b/doc/src/manual/ranch.asciidoc @@ -120,7 +120,7 @@ Ref = ref():: Listener name. Return the status of the given listener. -=== get_transport_options(Ref) -> ProtoOpts +=== get_transport_options(Ref) -> TransOpts Ref = ref():: Listener name. TransOpts = any():: Current transport options. @@ -138,6 +138,7 @@ Return detailed information about all Ranch listeners. The following keys are defined: pid:: Pid of the listener's top-level supervisor. +status:: Listener status, either running or suspended. ip:: Interface Ranch listens on. port:: Port number Ranch listens on. num_acceptors:: Number of acceptor processes. @@ -149,6 +150,16 @@ transport_options:: Transport options. protocol:: Protocol module. protocol_options:: Protocol options. +=== info(Ref) -> [{Key, Value}] + +Ref = ref():: Listener name. +Key = atom():: Information key. +Value = any():: Information value. + +Return detailed information about a specific Ranch listener. + +See `info/0` for a description of the defined keys. + === procs(Ref, acceptors | connections) -> [pid()] Ref = ref():: Listener name. @@ -253,3 +264,12 @@ If the listener is already suspended, nothing will happen. The listener will stop listening and accepting connections by closing the listening port, but will not stop running connection processes. + +=== wait_for_connections(Ref, Operator, NumConnections) -> ok + +Ref = ref():: Listener name. +Operator = '>' | '>=' | '==' | '=<' | '<':: Comparison operator. +NumConnections = non_neg_integer():: Number of connections to wait for. + +Wait until the number of connections on the given listener matches +the given operator and number of connections. \ No newline at end of file -- cgit v1.2.3