mirror of
https://github.com/samuelncui/acp.git
synced 2026-01-07 11:45:15 +00:00
feat: add event
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
package acp
|
||||
|
||||
type deviceOption struct {
|
||||
linear bool
|
||||
linear bool
|
||||
threads int
|
||||
}
|
||||
|
||||
func (do *deviceOption) check() {
|
||||
if do.threads == 0 {
|
||||
do.threads = 8
|
||||
}
|
||||
if do.linear {
|
||||
do.threads = 1
|
||||
}
|
||||
}
|
||||
|
||||
type DeviceOption func(*deviceOption) *deviceOption
|
||||
@@ -12,3 +22,10 @@ func LinearDevice(b bool) DeviceOption {
|
||||
return d
|
||||
}
|
||||
}
|
||||
|
||||
func DeviceThreads(threads int) DeviceOption {
|
||||
return func(d *deviceOption) *deviceOption {
|
||||
d.threads = threads
|
||||
return d
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user