Skip to content

Commit

Permalink
little
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Jun 27, 2024
1 parent 2af6a16 commit af03df6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
go-ver: ["1.21", "1.20", "1.19"]
go-ver: ["1.22", "1.21", "1.20", "1.19"]
include:
- os: "ubuntu-latest"
go-ver: "1.21"
go-ver: "1.22"
cover: true

runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions batch4.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (c *Coordinator[Res]) Notify() {
// It returns index of entered worker.
// 0 means we are the first and we should reset the shared state.
// If blocking == false and batch is not available negative value returned.
// Enter also removes worker from the queue.
func (c *Coordinator[Res]) Enter(blocking bool) int {
c.mu.Lock()

Expand Down
8 changes: 4 additions & 4 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Logic for Coordinator
Workers are distributed among multiple coaches and then each coach works the same as in Coordinator case.
-------------------------
| -> | state is combined in a | /--> worker0
-> worker0 -> | -> | few independent coaches | -> result ---> worker1
| -> | workers are ditributed | /--> worker0
-> worker0 -> | -> | among free coaches | -> result ---> worker1
-> worker1 -> | -------------------------
-> worker2 -> |
-> worker3 -> | -------------------------
| -> | each is committed as an | /--> worker2
| -> | independent part | -> result ---> worker3
| -> | state is combined in a | /--> worker2
| -> | few independent coaches | -> result ---> worker3
-------------------------
Full Guide
Expand Down
3 changes: 3 additions & 0 deletions multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (c *Multi[Res]) Notify() {

// Enter enters available batch.
// It will return -1, -1 if no coaches available and blocking == false.
// Enter also removes worker from the queue.
//
// See also documentation for Coordinator.Enter.
//
// coach choice can be configured by setting custom Multi.Balancer.
func (c *Multi[Res]) Enter(blocking bool) (coach, idx int) {
Expand Down

0 comments on commit af03df6

Please sign in to comment.