pub struct RuntimeConfig { /* private fields */ }
Expand description

Controls options for running puff tasks.

See the Readme’s Architecture Section for more information about the multi-threaded tokio runtime, coroutine threads, and blocking threads to get a better understanding of these options. The default options should be sane for most applications.

Examples

use puff_rs::runtime::RuntimeConfig;
let config = RuntimeConfig::default();

Implementations

Create a new default config.

Get the current max_blocking_threads

This is the number of threads that can be spawned for blocking tasks.

Get the current tokio_worker_threads

This is the number of threads that Tokio will use to execute things like DB queries, HTTP Servers, and IO. These threads can share and distribute tasks amongst themselves.

Get the current blocking_task_keep_alive

The maximum time a blocking thread can keep executing before being killed.

Get if a global redis will be enabled.

Get if a global postgres will be enabled.

Get if a global pubsub will be enabled.

Get if a global pubsub will be enabled.

Get if a global task_queue will be enabled.

Get if greenlets will be enabled.

Get if asyncio will be enabled.

Get the gql modules that will be enabled.

Get all python paths to add to environment.

Get all env vars to add to environment.

Apply env vars to add to environment.

Get the global Python object

Set the tokio_worker_threads for coroutines.

Default: num_cpus

Set the blocking_task_keep_alive.

Default: 30 seconds

Set the max_blocking_threads.

Default: 1024

Sets whether to start with python.

Default: true

Sets whether to start with a global Redis pool.

Configure an additional named redis pool.

Sets whether to start with a global Postgres pool.

Configure an additional named Postgres pool.

Sets whether to start with a global PubSubClient.

Sets whether to start with a global PubSubClient.

Add global HTTP Client

Add named HTTP Client

Sets whether to start with a global TaskQueue.

Sets whether to start with a global TaskQueue.

Sets whether to use greenlets when executing python.

Default: true

Sets whether to use greenlets when executing python.

Default: false

If provided, will load the GraphQl configuration from the module path to the Schema.

Default: None

If provided, will load an additional GraphQl configuration from the path to the Schema.

Default: None

Run a function in a python context and set the result as the global state for Python.

Default: None

Add the current directory to the PYTHONPATH

Add the current directory to the PYTHONPATH

Add the relative directory to the PYTHONPATH

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more