generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(async): change worker gr lifetime (#4)
- Loading branch information
1 parent
43c9f9a
commit a2dca17
Showing
10 changed files
with
416 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package async | ||
|
||
type workerInfo[I, R any] struct { | ||
job Job[I] | ||
resultsOut ResultStreamOut[R] | ||
finishedOut FinishedStreamOut | ||
} | ||
|
||
const ( | ||
// TODO: This is just temporary, channel size definition still needs to be | ||
// fine tuned | ||
// | ||
DefaultChSize = 100 | ||
) | ||
|
||
type workerWrapper[I any, R any] struct { | ||
cancelChOut chan<- CancelWorkSignal | ||
core *worker[I, R] | ||
} | ||
|
||
type workersCollection[I, R any] map[WorkerID]*workerWrapper[I, R] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.