From e0759a00d9aca282d4743133570f683d3c1bc0c8 Mon Sep 17 00:00:00 2001 From: Jan Buchar Date: Thu, 8 Dec 2016 15:15:51 +0100 Subject: [PATCH] headers elaboration --- Broker.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Broker.md b/Broker.md index fdcf8ee..43285e6 100644 --- a/Broker.md +++ b/Broker.md @@ -30,9 +30,16 @@ especially when some kind of error happens on the server. The `worker_registry` class is used to store information about workers, their status and the jobs in their queue. It can look up a worker using the headers received with a request (a worker is considered suitable if and only if it -satisfies all the headers). It also uses a basic load balancing algorithm -- the +satisfies all the headers). The headers are arbitrary key-value pairs, which +are checked for equality by the broker. However, some headers require special +handling, namely `threads`, for which we check if the value in the request is +lesser than or equal to the value advertised by the worker, and `hwgroup`, for +which we support requesting one of multiple hardware groups by listing multiple +names separated with a `|` symbol (e.g. `group_1|group_2|group_3`. + +The registry also implements a basic load balancing algorithm -- the workers are contained in a queue and whenever one of them receives a job, it is -moved to the back, which makes it less likely to receive another job soon. +moved to its end, which makes it less likely to receive another job soon. When a worker is assigned a job, it will not be assigned another one until we receive a `done` message from it.