From 48f39402181d959cad88cb3f460210c007169f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 12 May 2021 11:13:47 +0200 Subject: Cowboy 2.9.0 --- .../manual/ranch.wait_for_connections/index.html | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 docs/en/ranch/1.8/manual/ranch.wait_for_connections/index.html (limited to 'docs/en/ranch/1.8/manual/ranch.wait_for_connections') diff --git a/docs/en/ranch/1.8/manual/ranch.wait_for_connections/index.html b/docs/en/ranch/1.8/manual/ranch.wait_for_connections/index.html new file mode 100644 index 00000000..7a661190 --- /dev/null +++ b/docs/en/ranch/1.8/manual/ranch.wait_for_connections/index.html @@ -0,0 +1,213 @@ + + + + + + + + + + Nine Nines: ranch:wait_for_connections(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

ranch:wait_for_connections(3)

+ +

Name

+

ranch:wait_for_connections - Wait for a specific number of connections

+

Description

+
+
wait_for_connections(Ref      :: ranch:ref(),
+                     Operator,
+                     NumConns :: non_neg_integer())
+    -> ok
+
+Operator :: '>' | '>=' | '==' | '=<' | '<'
+
+

Wait for a specific number of connections.

+

This function waits until the number of connections on the given listener becomes higher than, equal to or lower than the given number. It never returns otherwise.

+

This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener.

+ +

Arguments

+
Ref
+

The listener name.

+
+
Operator
+

The operator to use for the comparison.

+
+
NumConns
+

The number of connections to reach.

+
+
+

Return value

+

The atom ok is always returned. It can be safely ignored.

+

Changelog

+
  • 1.6: Function introduced. +
  • +
+

Examples

+
Wait for at least 100 connections
+
+
ranch:wait_for_connections(example, '>=', 100).
+
+
Gracefully shutdown a listener
+
+
Ref = example,
+
+ok = ranch:suspend_listener(Ref),
+ranch:wait_for_connections(Ref, '==', 0),
+ok = ranch:stop_listener(Ref).
+
+

See also

+

ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch(3)

+ + + + + + +
+ +
+ + +

+ Ranch + 1.8 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3