diff options
author | Loïc Hoguin <[email protected]> | 2019-09-26 10:43:12 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-09-26 10:53:00 +0200 |
commit | d86d55c1f90b37d991e20ad0f1ac37b1e38b36e1 (patch) | |
tree | 23a34ec9158d6abfddc6142923535304c02662c1 /doc/src/manual/gun.set_owner.asciidoc | |
parent | d9a970be90d0105af215531d74809878f9c21338 (diff) | |
download | gun-d86d55c1f90b37d991e20ad0f1ac37b1e38b36e1.tar.gz gun-d86d55c1f90b37d991e20ad0f1ac37b1e38b36e1.tar.bz2 gun-d86d55c1f90b37d991e20ad0f1ac37b1e38b36e1.zip |
Add a function to change the connection owner
While at it the gun:info/1 function has been fixed to work
even when we are in the not_connected state, and the owner
is now also returned.
Diffstat (limited to 'doc/src/manual/gun.set_owner.asciidoc')
-rw-r--r-- | doc/src/manual/gun.set_owner.asciidoc | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/src/manual/gun.set_owner.asciidoc b/doc/src/manual/gun.set_owner.asciidoc new file mode 100644 index 0000000..ee12a67 --- /dev/null +++ b/doc/src/manual/gun.set_owner.asciidoc @@ -0,0 +1,57 @@ += gun:set_owner(3) + +== Name + +gun:set_owner - Set a new owner for the connection + +== Description + +[source,erlang] +---- +set_owner(ConnPid, OwnerPid) -> ok + +ConnPid :: pid() +OwnerPid :: pid() +---- + +Set a new owner for the connection. + +Only the current owner of the connection can set a new +owner. + +Gun monitors the owner of the connection and automatically +shuts down gracefully when the owner exits. + +== Arguments + +ConnPid:: + +The pid of the Gun connection process. + +OwnerPid:: + +The pid of the new owner for the connection. + +== Return value + +The atom `ok` is returned. + +== Changelog + +* *2.0*: Function introduced. + +== Examples + +.Set a new owner for the connection +[source,erlang] +---- +ok = gun:set_owner(ConnPid, OwnerPid). +---- + +== See also + +link:man:gun(3)[gun(3)], +link:man:gun:open(3)[gun:open(3)], +link:man:gun:open_unix(3)[gun:open_unix(3)], +link:man:gun:shutdown(3)[gun:shutdown(3)], +link:man:gun:close(3)[gun:close(3)] |