mirror of
https://github.com/NUTtech/bell.git
synced 2024-11-24 08:12:15 +02:00
issue-14: change queueSize type to uint
This commit is contained in:
parent
49ae09c397
commit
618cf47420
6
bell.go
6
bell.go
@ -24,7 +24,7 @@ type Events struct {
|
||||
sync.RWMutex
|
||||
channels map[string][]chan Message
|
||||
wg sync.WaitGroup
|
||||
queueSize int
|
||||
queueSize uint
|
||||
}
|
||||
|
||||
// New constructor for Events
|
||||
@ -33,7 +33,7 @@ func New() *Events {
|
||||
}
|
||||
|
||||
// Queue set events queue size
|
||||
func (e *Events) Queue(size int) *Events {
|
||||
func (e *Events) Queue(size uint) *Events {
|
||||
e.Lock()
|
||||
defer e.Unlock()
|
||||
|
||||
@ -180,6 +180,6 @@ func Wait() {
|
||||
}
|
||||
|
||||
// Queue set events queue size
|
||||
func Queue(size int) {
|
||||
func Queue(size uint) {
|
||||
globalState.Queue(size)
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ func TestWait(t *testing.T) {
|
||||
|
||||
// TestQueue checking function for set queue size
|
||||
func TestQueue(t *testing.T) {
|
||||
size := 6
|
||||
var size uint = 6
|
||||
Queue(size)
|
||||
assert.Equal(t, size, globalState.queueSize)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user