Struct puff_rs::context::RealPuffContext
source · pub struct RealPuffContext { /* private fields */ }Implementations
sourceimpl RealPuffContext
impl RealPuffContext
sourcepub fn empty(handle: Handle) -> PuffContext
pub fn empty(handle: Handle) -> PuffContext
Creates an empty RuntimeDispatcher with no active threads for testing.
sourcepub fn new(handle: Handle) -> PuffContext
pub fn new(handle: Handle) -> PuffContext
Creates a new RuntimeDispatcher using the supplied RuntimeConfig.
sourcepub fn new_with_options(
handle: Handle,
redis: HashMap<String, RedisClient>,
postgres: HashMap<String, PostgresClient>,
python_dispatcher: Option<PythonDispatcher>,
pubsub_client: HashMap<String, PubSubClient>,
task_queue_client: HashMap<String, TaskQueue>,
gql_roots: HashMap<String, PuffGraphqlConfig>,
http_client: HashMap<String, PyHttpClient>
) -> PuffContext
pub fn new_with_options(
handle: Handle,
redis: HashMap<String, RedisClient>,
postgres: HashMap<String, PostgresClient>,
python_dispatcher: Option<PythonDispatcher>,
pubsub_client: HashMap<String, PubSubClient>,
task_queue_client: HashMap<String, TaskQueue>,
gql_roots: HashMap<String, PuffGraphqlConfig>,
http_client: HashMap<String, PyHttpClient>
) -> PuffContext
Creates a new RuntimeDispatcher using the supplied RuntimeConfig. This function will start
the number of coroutine_threads specified in your config. Includes options.
sourcepub fn pubsub(&self) -> PubSubClient
pub fn pubsub(&self) -> PubSubClient
The global configured PubSubClient
sourcepub fn pubsub_named(&self, key: &str) -> PubSubClient
pub fn pubsub_named(&self, key: &str) -> PubSubClient
The named configured PubSubClient
sourcepub fn http_client(&self) -> PyHttpClient
pub fn http_client(&self) -> PyHttpClient
The global configured reqwest::Client
sourcepub fn http_client_named(&self, key: &str) -> PyHttpClient
pub fn http_client_named(&self, key: &str) -> PyHttpClient
The global configured reqwest::Client
sourcepub fn task_queue(&self) -> TaskQueue
pub fn task_queue(&self) -> TaskQueue
The global configured PubSubClient
sourcepub fn task_queue_named(&self, key: &str) -> TaskQueue
pub fn task_queue_named(&self, key: &str) -> TaskQueue
The global configured PubSubClient
sourcepub fn python_dispatcher(&self) -> PythonDispatcher
pub fn python_dispatcher(&self) -> PythonDispatcher
A Handle into the multi-threaded async runtime
sourcepub fn redis(&self) -> RedisClient
pub fn redis(&self) -> RedisClient
The configured redis client. Panics if not enabled.
sourcepub fn redis_named(&self, key: &str) -> RedisClient
pub fn redis_named(&self, key: &str) -> RedisClient
The configured redis client. Panics if not enabled.
sourcepub fn postgres(&self) -> PostgresClient
pub fn postgres(&self) -> PostgresClient
The configured postgres client. Panics if not enabled.
sourcepub fn postgres_safe(&self) -> Option<PostgresClient>
pub fn postgres_safe(&self) -> Option<PostgresClient>
The configured postgres client.
sourcepub fn postgres_named(&self, key: &str) -> PostgresClient
pub fn postgres_named(&self, key: &str) -> PostgresClient
The configured postgres client. Panics if not enabled.
sourcepub fn postgres_safe_named(&self, key: &str) -> Option<PostgresClient>
pub fn postgres_safe_named(&self, key: &str) -> Option<PostgresClient>
The configured postgres client.
sourcepub fn gql(&self) -> PuffGraphqlConfig
pub fn gql(&self) -> PuffGraphqlConfig
The configured graphql root node. Panics if not enabled.
sourcepub fn gql_named(&self, key: &str) -> PuffGraphqlConfig
pub fn gql_named(&self, key: &str) -> PuffGraphqlConfig
The configured named graphql root node. Panics if not enabled.