-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hello,
I'm very impressed with the work you did on this library. Very neat indeed. I had a question for you... in your implementation of the Promise
struct, is there a reason why status
doesn't need to be mutex protected?
type Promise struct {
// Fn represent the underlaying promised function
fn func(*Promise, ...interface{})
// Args represents the arguments that needs to be passed when the promise is invoked
args []interface{}
// Not Started: 0
// Pending: 1
// Finished: 2
status byte // <---- does this status variable need to be protected by a mutex or rwmutex?
wg sync.WaitGroup
then ThenHandler
// Result
result interface{}
// Error
err error
batch bool
}
Metadata
Metadata
Assignees
Labels
No labels