Skip to content

Commit

Permalink
single_flight: plugin can now be registered from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Oct 4, 2021
1 parent 6ede745 commit 47acee1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dispatcher/plugin/executable/single_flight/single_flight.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ const (
)

func init() {
handler.RegInitFunc(PluginType, Init, func() interface{} { return new(Args) })
handler.MustRegPlugin(&singleFlight{BP: handler.NewBP("_single_flight", PluginType)}, true)
}

type Args struct{}

func Init(bp *handler.BP, args interface{}) (p handler.Plugin, err error) {
return &singleFlight{
BP: bp,
}, err
}

type singleFlight struct {
*handler.BP

Expand Down

0 comments on commit 47acee1

Please # to comment.