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 RouteLoader(IRouteLoader): (source)
Constructor: RouteLoader(app, router, compiler, cache)
Undocumented
| Method | __get |
Build the cache persistence handle for compiled routes. |
| Method | __import |
Import a route file by kind so its fluent registrations run. |
| Method | __init__ |
Initialise the RouteLoader with its required collaborators. |
| Method | __load |
Load compiled routes, using the persistent cache when available. |
| Method | load |
Return all compiled routes, loading them first if necessary. |
| Constant | _KINDS |
Undocumented |
| Instance Variable | __app |
Undocumented |
| Instance Variable | __app |
Undocumented |
| Instance Variable | __cache |
Undocumented |
| Instance Variable | __compiler |
Undocumented |
| Instance Variable | __fallback |
Undocumented |
| Instance Variable | __loaded |
Undocumented |
| Instance Variable | __persistence |
Undocumented |
| Instance Variable | __router |
Undocumented |
| Instance Variable | __routes |
Undocumented |
| Instance Variable | __use |
Undocumented |
| Property | fallback |
Return the registered fallback handler, if any. |
Build the cache persistence handle for compiled routes.
| Returns | |
IFileBasedCache | None | A FileBasedCache instance when the application has a compiled cache directory configured, None otherwise. |
IApplication, router: IRouter, compiler: RouteCompiler, cache: RouteCache):
(source)
¶
Initialise the RouteLoader with its required collaborators.
| Parameters | |
app:IApplication | Application instance used to resolve paths and settings. |
router:IRouter | Router that holds the raw registered routes. |
compiler:RouteCompiler | Compiler that converts raw routes to CompiledRoute objects. |
cache:RouteCache | Serialiser/deserialiser for the compiled route cache. |
| Returns | |
None | The instance is initialised; no value is returned. |
Load compiled routes, using the persistent cache when available.
On a cache hit the routes and fallback are deserialised directly. On a cache miss all route files are imported (which registers routes in the router), the compiler builds CompiledRoute objects, and the result is persisted for subsequent requests. An absent fallback is normalized to None before persistence, matching the representation restored from cache.
| Returns | |
None | Populates self.__routes and self.__fallback in place; no value is returned. |
Return the registered fallback handler, if any.
The fallback is used when no route matches the incoming request. Accessing this property triggers route loading if it has not already occurred.
| Returns | |
tuple | None | (class, method_name) for controller-based fallbacks, (None, callable) for callable-based fallbacks, or None if no fallback has been registered, whether routes are compiled on demand or restored from cache. |