Created
February 1, 2017 07:16
-
-
Save inotnako/5c295363b0d7ef7201ed04ba78ee82fc to your computer and use it in GitHub Desktop.
queue.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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