2014-06-21 21:22:38 +00:00
|
|
|
package worker
|
|
|
|
|
|
|
|
import (
|
2014-09-29 01:36:24 +00:00
|
|
|
"code.google.com/p/go.net/context"
|
2014-06-21 21:22:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Worker interface {
|
2014-09-29 01:36:24 +00:00
|
|
|
Do(context.Context, *Work)
|
2014-06-21 21:22:38 +00:00
|
|
|
}
|
|
|
|
|
2014-09-29 01:36:24 +00:00
|
|
|
// Do retrieves a worker from the session and uses
|
|
|
|
// it to get work done.
|
|
|
|
func Do(c context.Context, w *Work) {
|
|
|
|
FromContext(c).Do(c, w)
|
2014-06-21 21:22:38 +00:00
|
|
|
}
|