Skip to content

Instantly share code, notes, and snippets.

@inotnako
Created February 1, 2017 07:16
Show Gist options
  • Save inotnako/5c295363b0d7ef7201ed04ba78ee82fc to your computer and use it in GitHub Desktop.
Save inotnako/5c295363b0d7ef7201ed04ba78ee82fc to your computer and use it in GitHub Desktop.
queue.go
package queue
type Command interface {
Process(ctx context, task string, arg interface{}) Command
/*
// like tree
proc := cmd.Pocess(ctx, `users.GerAll`,&users.Req{Filter: true})
proc.Pipe(`users.Reindex`)
proc.Pipe(`users.FlushData`)
proc.Pipe(`users.SendNews`)
proc.Do()
// like pipe
err := cmd.Pocess(ctx, `users.GerAll`,&users.Req{Filter: true}).Pipe(`users.Reindex`).Pipe(`reporter.Report`).Do()
*/
Pipe(task string) Command
Do() error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment