THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class RouteCache(IRouteCache): (source)
Undocumented
| Static Method | __deserialize |
Rebuild a CompiledRoute from a cache dict. |
| Static Method | __deserialize |
Rebuild the fallback tuple from a cache descriptor dict. |
| Static Method | __resolve |
Import and return a class given its fully-qualified dotted path. |
| Static Method | __resolve |
Resolve a module-level qualname into its target object. |
| Static Method | __serialize |
Convert a CompiledRoute to a JSON-safe dict. |
| Static Method | __serialize |
Serialise the fallback tuple to a JSON-safe descriptor dict. |
| Method | from |
Rebuild compiled routes and the fallback handler from a cache dict. |
| Method | to |
Serialise compiled routes and the fallback handler to a cache dict. |
| Constant | VERSION |
Undocumented |
dict, resolved_classes: dict[ str, type], method: str, *, static_path: str | None = None) -> CompiledRoute:
(source)
¶
Rebuild a CompiledRoute from a cache dict.
regex and converters are recomputed via
RouteCompiler.compilePath so that callable converters
(including lambdas) never need to be serialised.
| Parameters | |
routedict | Dict produced by __serializeCompiledRoute. |
resolveddict[str, type] | Class references shared across this cache load. |
method:str | Dispatch method owning this cache bucket. |
staticstr | None, optional | Expected path for static entries; None selects a dynamic entry. |
| Returns | |
CompiledRoute | Fully initialised compiled route. |
| Raises | |
ValueError | If transport, path or bucket metadata contradicts the cached route. |
Rebuild the fallback tuple from a cache descriptor dict.
| Parameters | |
data:dict | None | Descriptor produced by __serializeFallback. |
| Returns | |
tuple | None | Fallback tuple for the dispatch engine, or None. |
Resolve a module-level qualname into its target object.
| Parameters | |
modulestr | Import path of the module containing the object. |
qualname:str | Qualname to resolve, potentially with dotted nesting. |
| Returns | |
object | Resolved target object. |
| Raises | |
ValueError | If the qualname contains <locals>, which cannot be safely restored from cache. |
Convert a CompiledRoute to a JSON-safe dict.
regex and converters are omitted — they are fully deterministic from path and recomputed on deserialisation. Middleware class references are stored as dotted import paths.
| Parameters | |
cr:CompiledRoute | The compiled route to serialise. |
| Returns | |
dict | JSON-safe representation of the compiled route. |
Serialise the fallback tuple to a JSON-safe descriptor dict.
| Parameters | |
fallback:tuple | None | Raw fallback tuple from the router. |
| Returns | |
dict | None | Descriptor dict, or None if no fallback is registered. |