Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prefork ¶
type Prefork struct { // The network must be "tcp", "tcp4" or "tcp6". // // By default is "tcp4" Network string // Flag to use a listener with reuseport, if not a file Listener will be used // See: https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/ // // It's disabled by default Reuseport bool ServeFunc func(ln net.Listener) error ServeTLSFunc func(ln net.Listener, certFile, keyFile string) error ServeTLSEmbedFunc func(ln net.Listener, certData, keyData []byte) error // contains filtered or unexported fields }
Prefork implements fasthttp server prefork
Preforks master process (with all cores) between several child processes increases performance significantly, because Go doesn't have to share and manage memory between cores
WARNING: using prefork prevents the use of any global state! Things like in-memory caches won't work.
func (*Prefork) ListenAndServe ¶
ListenAndServe serves HTTP requests from the given TCP addr
func (*Prefork) ListenAndServeTLS ¶
ListenAndServeTLS serves HTTPS requests from the given TCP addr
certFile and keyFile are paths to TLS certificate and key files.
Click to show internal directories.
Click to hide internal directories.