Skip to content
/ fd Public
forked from ftrvxmtrx/fd

Pass Go file descriptors and connections between different OS processes.

License

Notifications You must be signed in to change notification settings

franklyinc/fd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fd

Package fd provides a simple API to pass file descriptors between different OS processes.

It can be useful if you want to inherit network connections from another process without closing them.

Example scenario:

  • Running server receives a "let's upgrade" message
  • Server opens a Unix domain socket for the "upgrade"
  • Server starts a new copy of itself and passes Unix domain socket name
  • New copy starts reading for the socket
  • Server sends its state over the socket, also sending the number of network connections to inherit, then it sends those connections using fd.Put()
  • New copy reads the state and inherits connections using fd.Get(), checks that everything is OK and sends the "OK" message to the socket
  • Server receives "OK" message and kills itself

Documentation

fd on go.pkgdoc.org

Build status

<a href="http://goci.me/project/github.com/ftrvxmtrx/fd>

About

Pass Go file descriptors and connections between different OS processes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%