{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stackless\n\nPackage stackless provides functionality that may save stack space for high number of concurrently running goroutines.\n\n## Functions\n\n```go\nfunc NewFunc(f func(ctx interface{})) func(ctx interface{}) bool\n```\nNewFunc returns stackless wrapper for the function f.\n\nUnlike f, the returned stackless wrapper doesn't use stack space on the goroutine that calls it. The wrapper may save a lot of stack space if the following conditions are met:\n\n  - f doesn't contain blocking calls on network, I/O or channels;\n  - f uses a lot of stack space;\n  - the wrapper is called from high number of concurrent goroutines.\n\nThe stackless wrapper returns false if the call cannot be processed at the moment due to high load.\n\n## Types\n\n```go\ntype NewWriterFunc func(w io.Writer) Writer\n```\nNewWriterFunc must return new writer that will be wrapped into stackless writer.\n\n```go\ntype Writer interface {\n\tWrite(p []byte) (int, error)\n\tFlush() error\n\tClose() error\n\tReset(w io.Writer)\n}\n```\nWriter is an interface stackless writer must conform to.\n\nThe interface contains common subset for Writers from compress/\\* packages.\n\n```go\nfunc NewWriter(dstW io.Writer, newWriter NewWriterFunc) Writer\n```\nNewWriter creates a stackless writer around a writer returned from newWriter.\n\nThe returned writer writes data to dstW.\n\nWriters that use a lot of stack space may be wrapped into stackless writer, thus saving stack space for high number of concurrently running goroutines.\n\n","path":"github.com/infinitbyte/framework/lib/fasthttp/stackless","name":"stackless","synopsis":"Package stackless provides functionality that may save stack space for high number of concurrently running goroutines.","isRedistributable":true}
