From d9f9d4dc30cf6bbd6f5fc2b8a8bb6d895e4c209d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Fri, 12 Jan 2024 16:33:18 +0100 Subject: Allow specifying functions for reply_to LH: I have fixed types, extended tests and tweaked a bit. --- doc/src/manual/gun.asciidoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/manual/gun.asciidoc b/doc/src/manual/gun.asciidoc index 60f217a..ece9d2a 100644 --- a/doc/src/manual/gun.asciidoc +++ b/doc/src/manual/gun.asciidoc @@ -442,7 +442,8 @@ Request headers. ---- req_opts() :: #{ flow => pos_integer(), - reply_to => pid() + reply_to => pid() | {module(), atom(), list()} + | fun((_) -> _) | {fun(), list()} } ---- @@ -457,7 +458,8 @@ flow control is disabled. reply_to (`self()`):: -The pid of the process that will receive the response messages. +The pid of the process that will receive the response messages, +or a function that will be called with the message as argument. === socks_opts() @@ -598,6 +600,7 @@ By default no user option is defined. == Changelog +* *2.2*: The `reply_to` option now accepts functions. * *2.1*: The HTTP/2 option list was updated with new options. * *2.0*: The `default_protocol` and `user_opts` Websocket options were added. -- cgit v1.2.3