Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
[#73]: feature: after_init option
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored May 22, 2023
2 parents 1782417 + b2bbcfa commit ee68130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pool/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ type Config struct {
// Command used to override the server command with the custom one
Command string `mapstructure:"command"`

// AfterInitCommand command used to override the server's AfterInitCommand
AfterInitCommand string `mapstructure:"after_init"`

// NumWorkers defines how many sub-processes can be run at once. This value
// might be doubled by Swapper while hot-swap. Defaults to number of CPU cores.
NumWorkers uint64 `mapstructure:"num_workers"`
Expand Down
2 changes: 1 addition & 1 deletion pool/static_pool/static_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Pool struct {
}

// NewPool creates new worker pool and task multiplexer. Pool will initiate with one worker. If supervisor configuration is provided -> pool will be turned into a supervisedExec mode
func NewPool(ctx context.Context, cmd pool.Command, factory pool.Factory, cfg *pool.Config, log *zap.Logger) (*Pool, error) {
func NewPool(ctx context.Context, cmd pool.Command, factory pool.Factory, cfg *pool.Config, log *zap.Logger, options ...Options) (*Pool, error) {
if factory == nil {
return nil, errors.Str("no factory initialized")
}
Expand Down

0 comments on commit ee68130

Please sign in to comment.