generator: Can perform synchronous generation
This commit is contained in:
parent
ec98e521dc
commit
1769938205
13 changed files with 214 additions and 81 deletions
|
|
@ -15,4 +15,20 @@ type GenStruct struct {
|
|||
Id string `json:"id"`
|
||||
Type GenerateType `json:"type"`
|
||||
TeamId int64 `json:"team_id,omitempty"`
|
||||
ended chan error
|
||||
}
|
||||
|
||||
func (gs *GenStruct) GenEnded() chan error {
|
||||
gs.ended = make(chan error, 1)
|
||||
return gs.ended
|
||||
}
|
||||
|
||||
func (gs *GenStruct) GetEnded() chan error {
|
||||
return gs.ended
|
||||
}
|
||||
|
||||
func (gs *GenStruct) End(err error) {
|
||||
if gs.ended != nil {
|
||||
gs.ended <- err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue