-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(event_handler): allow responses and metadata when using Router (#…
…3514) Co-authored-by: Heitor Lessa <[email protected]>
- Loading branch information
1 parent
5dc225b
commit ebb10ea
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class _FrozenDict(dict): | ||
""" | ||
A dictionary that can be used as a key in another dictionary. | ||
This is needed because the default dict implementation is not hashable. | ||
The only usage for this right now is to store dicts as part of the Router key. | ||
The implementation only takes into consideration the keys of the dictionary. | ||
MAINTENANCE: this is a temporary solution until we refactor the route key into a class. | ||
""" | ||
|
||
def __hash__(self): | ||
return hash(frozenset(self.keys())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters