Snakepit.PythonThreadLimits (Snakepit v0.6.10)

View Source

Normalizes Python threading configuration with safe defaults.

Resolves partial overrides pulled from application environment and produces a complete map ready for runtime consumption.

Summary

Types

t()

Thread limit configuration keyed by known library identifiers.

Functions

Default thread limit configuration.

Merge a user-supplied configuration with defaults.

Types

t()

@type t() :: %{
  optional(:openblas) => pos_integer(),
  optional(:omp) => pos_integer(),
  optional(:mkl) => pos_integer(),
  optional(:numexpr) => pos_integer(),
  optional(:grpc_poll_threads) => pos_integer()
}

Thread limit configuration keyed by known library identifiers.

Functions

defaults()

@spec defaults() :: t()

Default thread limit configuration.

resolve(config)

@spec resolve(nil | map() | keyword()) :: t()

Merge a user-supplied configuration with defaults.

Accepts nil, maps with atom keys, or keyword lists. Unknown keys are ignored; non-integer values are coerced with String.to_integer/1 when possible.