Skip to content

Commit

Permalink
- Provide grace timeout from the plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Mar 31, 2021
1 parent be27b2d commit 9662753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions activity/activity_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type activityPoolImpl struct {
}

// newActivityPool
func newActivityPool(codec rrt.Codec, listener events.Listener, poolConfig pool.Config, server server.Server) (activityPool, error) {
func newActivityPool(codec rrt.Codec, graceTimeout time.Duration, listener events.Listener, poolConfig pool.Config, server server.Server) (activityPool, error) {
const op = errors.Op("new_activity_pool")
// env variables
env := map[string]string{RR_MODE: roadrunner_temporal.RRMode, RR_CODEC: codec.GetName()}
Expand All @@ -63,9 +63,10 @@ func newActivityPool(codec rrt.Codec, listener events.Listener, poolConfig pool.
}

return &activityPoolImpl{
codec: codec,
wp: wp,
running: sync.Map{},
codec: codec,
wp: wp,
running: sync.Map{},
graceTimeout: graceTimeout,
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions activity/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func (p *Plugin) poolListener(event interface{}) {
func (p *Plugin) startPool() (activityPool, error) {
pool, err := newActivityPool(
p.temporal.GetCodec().WithLogger(p.log),
p.graceTimeout,
p.poolListener,
*p.temporal.GetConfig().Activities,
p.server,
Expand Down

0 comments on commit 9662753

Please sign in to comment.