From 92b54aacc0de5446dd5497c39897b0bbff72e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Jun 2018 09:54:12 +0200 Subject: Rebuild using Asciideck --- .../en/cowboy/2.0/manual/cowboy.set_env/index.html | 124 ++++++--------------- 1 file changed, 33 insertions(+), 91 deletions(-) (limited to 'docs/en/cowboy/2.0/manual/cowboy.set_env') diff --git a/docs/en/cowboy/2.0/manual/cowboy.set_env/index.html b/docs/en/cowboy/2.0/manual/cowboy.set_env/index.html index 1852ba03..13b12f32 100644 --- a/docs/en/cowboy/2.0/manual/cowboy.set_env/index.html +++ b/docs/en/cowboy/2.0/manual/cowboy.set_env/index.html @@ -62,117 +62,59 @@

cowboy:set_env(3)

-

Name

-
-

cowboy:set_env - Update a listener’s environment value

-
-
-
+

cowboy:set_env - Update a listener's environment value

Description

-
-
-
-
set_env(Name  :: ranch:ref(),
-        Key   :: atom(),
-        Value :: any())
-    -> ok
-

Set or update an environment value for a previously started -listener.

-

This is most useful for updating the routes dynamically, -without having to restart the listener.

-

The new value will only be available to new connections. -Pre-existing connections will still use the old value.

-
-
-
+
set_env(Name  :: ranch:ref(),
+        Key   :: atom(),
+        Value :: any())
+    -> ok
+
+

Set or update an environment value for a previously started listener.

+

This is most useful for updating the routes dynamically, without having to restart the listener.

+

The new value will only be available to new connections. Pre-existing connections will still use the old value.

Arguments

-
-
-
-Name -
-
-

-The name of the listener to update. -

-

The name of the listener is the first argument given to the -cowboy:start_clear(3), -cowboy:start_tls(3) or -ranch:start_listener(3) function.

+
Name
+

The name of the listener to update.

+

The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function.

-
-Key -
-
-

-The key in the environment map. Common keys include dispatch -and middlewares. -

+
Key
+

The key in the environment map. Common keys include dispatch and middlewares.

-
-Value -
-
-

-The new value. -

-

The type of the value differs depending on the key.

+
Value
+

The new value.

+

The type of the value differs depending on the key.

-
-
- -
+

Return value

-
-

The atom ok is returned on success.

-

An exit:badarg exception is thrown when the listener does -not exist.

-
-
-
+

The atom ok is returned on success.

+

An exit:badarg exception is thrown when the listener does not exist.

Changelog

-
-
    -
  • -

    -1.0: Function introduced. -

    +
    • 1.0: Function introduced.
    • -
-
-
-
+

Examples

-
-
-
Update a listener’s routes
-
-
Dispatch = cowboy_router:compile([
-    {'_', [
-        {"/", toppage_h, []},
-        {"/ws", websocket_h, []}
+
Dispatch = cowboy_router:compile([
+    {'_', [
+        {"/", toppage_h, []},
+        {"/ws", websocket_h, []}
     ]}
 ]),
 
-cowboy:set_env(example, dispatch, Dispatch).
-
-
-
+cowboy:set_env(example, dispatch, Dispatch). +

See also

-
- -
- +

cowboy(3), cowboy:start_clear(3), cowboy:start_tls(3), ranch:set_protocol_options(3)

+ -- cgit v1.2.3