Jido. Signal. Router. Engine
(Jido Signal v2.2.1)
View Source
The 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.
Checks if handlers exist at the exact path in the trie.
Removes a path from the trie and returns the number of handlers removed.
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 has_path?(Jido.Signal.Router.TrieNode.t(), [String.t()]) :: boolean()
Checks if handlers exist at the exact path in the trie.
@spec remove_path(String.t(), Jido.Signal.Router.TrieNode.t()) :: {Jido.Signal.Router.TrieNode.t(), non_neg_integer()}
Removes a path from the trie and returns the number of handlers removed.
@spec route_signal(Jido.Signal.Router.TrieNode.t(), Jido.Signal.t()) :: [term()]
Routes a signal through the trie to find matching handlers.