1use std::any::Any;
2use std::sync::Arc;
3
4use rivet_foundation::ConfigValue;
5use rivet_http::{Request, Response};
6
7use crate::error::RivetError;
8
9pub trait Dispatcher: Send + Sync {
14 fn dispatch(&self, req: Request) -> Response;
16
17 fn config_value(&self, _key: &str) -> Option<ConfigValue> {
19 None
20 }
21
22 fn resolve_any(
24 &self,
25 _type_name: &'static str,
26 ) -> Result<Arc<dyn Any + Send + Sync>, RivetError> {
27 Err(RivetError::Dispatch(
28 "app container access is not available on this dispatcher".to_string(),
29 ))
30 }
31}