generated from B1NARY-GR0UP/.github
-
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.
- Loading branch information
1 parent
9571af4
commit c0bcfa0
Showing
5 changed files
with
48 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package violin | ||
|
||
import "math" | ||
|
||
const ( | ||
DefaultViolinMaxWorkerNum = math.MaxInt32 | ||
DefaultViolinWorkerIdleTimeout = 0 | ||
) | ||
|
||
const ( | ||
_ uint32 = iota | ||
statusInitialized | ||
statusPlaying | ||
statusCleaning | ||
statusShutdown | ||
) |
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package violin | ||
|
||
// TODO: refer to ants | ||
|
||
var defaultViolin *Violin | ||
|
||
func init() { | ||
defaultViolin = New(WithMaxWorkers(DefaultViolinMaxWorkerNum), WithWorkerIdleTimeout(DefaultViolinWorkerIdleTimeout)) | ||
} | ||
|
||
func Submit(task func()) error { | ||
//return defaultViolin.Submit(task) | ||
return nil | ||
} | ||
|
||
func SubmitWait(task func()) error { | ||
//return defaultViolin.SubmitWait(task) | ||
return nil | ||
} | ||
|
||
func WorkerNum() uint32 { | ||
return defaultViolin.WorkerNum() | ||
} | ||
|
||
func MaxWorkerNum() int { | ||
return defaultViolin.MaxWorkerNum() | ||
} |
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