summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-23 20:00:15 -0500
committerWolfy-J <[email protected]>2018-01-23 20:00:15 -0500
commit2fa64cef5bc8f05b3185460aafddfd8ecc7d16a2 (patch)
tree5a98a190c9d470367e5be3adb5977df2627be611
parentaf36e5c30cdb538da352591d37e469e5fc1f7d5f (diff)
example
-rw-r--r--README.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4b90c365..5aa97e51 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,24 @@ Features:
- very fast (~200k calls per second on Ryzen 1700X over 17 threads)
- works on Windows
+Examples:
+--------
+
+```go
+pool, err := NewPool(
+ func() *exec.Cmd { return exec.Command("php", "worker.php") },
+ NewPipeFactory(),
+ Config{
+ NumWorkers: uint64(runtime.NumCPU()),
+ AllocateTimeout: time.Second,
+ DestroyTimeout: time.Second,
+ },
+)
+defer p.Destroy()
+
+rsp, err := p.Exec(&Payload{Body: []byte("hello")})
+```
+
License:
--------
The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. \ No newline at end of file