summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2017-12-26 19:14:53 +0300
committerWolfy-J <[email protected]>2017-12-26 19:14:53 +0300
commite229d83dea4bbe9d0cfe6569c8fbe239690aafb9 (patch)
tree2d4887ffdb167d660b705415f0617458490d0b9f /config.go
init
Diffstat (limited to 'config.go')
-rw-r--r--config.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.go b/config.go
new file mode 100644
index 00000000..e5d78d49
--- /dev/null
+++ b/config.go
@@ -0,0 +1,19 @@
+package roadrunner
+
+import "time"
+
+// Config defines basic behaviour of worker creation and handling process.
+type Config struct {
+ // MaxWorkers defines how many sub-processes can be run at once. This value might be doubled by Balancer while hot-swap.
+ MaxWorkers uint64
+
+ // MaxExecutions defines how many executions is allowed for the worker until it's destruction. Set 1 to create new process
+ // for each new task, 0 to let worker handle as many tasks as it can.
+ MaxExecutions uint64
+
+ // AllocateTimeout defines for how long pool will be waiting for a worker to be freed to handle the task.
+ AllocateTimeout time.Duration
+
+ // DestroyOnError when set to true workers will be destructed after any JobError.
+ DestroyOnError bool
+}