Jido.Signal.Router.Engine (Jido Signal v1.0.0)
View SourceThe routing engine that matches signals to handlers.
Summary
Functions
Builds the trie structure from validated routes.
Collects all routes from the trie into a list of Route structs.
Counts total routes in the trie.
Removes a path from the trie.
Routes a signal through the trie to find matching handlers.
Functions
@spec build_trie([Jido.Signal.Router.Route.t()], Jido.Signal.Router.TrieNode.t()) :: Jido.Signal.Router.TrieNode.t()
Builds the trie structure from validated routes.
@spec collect_routes(Jido.Signal.Router.TrieNode.t()) :: [ Jido.Signal.Router.Route.t() ]
Collects all routes from the trie into a list of Route structs.
@spec count_routes(Jido.Signal.Router.TrieNode.t()) :: non_neg_integer()
Counts total routes in the trie.
@spec remove_path(String.t(), Jido.Signal.Router.TrieNode.t()) :: Jido.Signal.Router.TrieNode.t()
Removes a path from the trie.
@spec route_signal(Jido.Signal.Router.TrieNode.t(), Jido.Signal.t()) :: [term()]
Routes a signal through the trie to find matching handlers.