{"_id":"55ed88392e66b621009941a9","__v":2,"category":{"_id":"55e94ebee5d0c623003ed86c","pages":["55e94ebfe5d0c623003ed86e","55ed7fdadf21af2b009e217d","55ed86db2e66b621009941a6","55ed879428d7c33700de00e1","55ed88392e66b621009941a9","55ed885cec4c3e3900b75611","55ed88ba2e66b621009941ab","55ed8caba872a80d00acff5d","55ed8ce82e66b621009941c3","560d5df697a0a32f006e9de9","566ff8f33a32d20d00c45b37","5670195e81801f0d00802e1c"],"version":"55e94ebee5d0c623003ed86b","__v":12,"project":"55e94ebde5d0c623003ed868","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-04T07:56:46.830Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"project":"55e94ebde5d0c623003ed868","user":"55e94db887e942230032e40d","version":{"_id":"55e94ebee5d0c623003ed86b","project":"55e94ebde5d0c623003ed868","__v":1,"createdAt":"2015-09-04T07:56:46.272Z","releaseDate":"2015-09-04T07:56:46.272Z","categories":["55e94ebee5d0c623003ed86c"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.3.0","version":"0.3.0"},"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-07T12:51:05.616Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"A slot is like a shared lock which can be acquired by one task at a time. When a client submits a task and requests to assign it to a *slot* then the broker will reject the request if there is another tasks in waiting or running status for that slot.\n\nThis is useful if you need to execute only one *kind* of tasks, which can be for example some sort of \"critical section\". By means of this simple algorithm it is possible to implement simple distributed locks without the need of expensive distributed lock algorithms. \n\nAssigning a task to the slot is like using the *Lock.tryAcquire* methods of Java Concurrent Locks facility.","excerpt":"","slug":"slots","type":"basic","title":"Slots"}
A slot is like a shared lock which can be acquired by one task at a time. When a client submits a task and requests to assign it to a *slot* then the broker will reject the request if there is another tasks in waiting or running status for that slot. This is useful if you need to execute only one *kind* of tasks, which can be for example some sort of "critical section". By means of this simple algorithm it is possible to implement simple distributed locks without the need of expensive distributed lock algorithms. Assigning a task to the slot is like using the *Lock.tryAcquire* methods of Java Concurrent Locks facility.