|
|
@ -6,7 +6,7 @@ import ( |
|
|
|
) |
|
|
|
|
|
|
|
type TaskChannel struct { |
|
|
|
name string |
|
|
|
name string |
|
|
|
c chan interface{} |
|
|
|
closed bool |
|
|
|
mutex sync.Mutex |
|
|
@ -14,7 +14,7 @@ type TaskChannel struct { |
|
|
|
|
|
|
|
func NewTaskChannel(name string) *TaskChannel { |
|
|
|
return &TaskChannel{ |
|
|
|
c: make(chan interface{}, 100), |
|
|
|
c: make(chan interface{}, 200), |
|
|
|
name: name, |
|
|
|
} |
|
|
|
} |
|
|
@ -54,7 +54,7 @@ func (c *TaskChannel) Read() (data interface{}, ok bool, err error) { |
|
|
|
return |
|
|
|
} |
|
|
|
c.mutex.Unlock() |
|
|
|
data, ok = <- c.c |
|
|
|
data, ok = <-c.c |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
@ -68,4 +68,4 @@ func (c *TaskChannel) ResetChannel() (err error) { |
|
|
|
c.closed = false |
|
|
|
c.c = make(chan interface{}, 50) |
|
|
|
return |
|
|
|
} |
|
|
|
} |