-
-
Notifications
You must be signed in to change notification settings - Fork 65
Hooks, typed callbacks, more builtin tables, no more tempstates #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or 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
Collaborator
Author
Collaborator
Author
Collaborator
Author
Collaborator
Author
Collaborator
Author
m-kus
reviewed
Aug 27, 2021
m-kus
reviewed
Aug 27, 2021
m-kus
reviewed
Aug 27, 2021
| self._blocks[block.level] = block | ||
| self._events[block.level].set() | ||
|
|
||
| last_blocks = sorted(self._blocks.keys())[-self._limit :] |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сложна
Collaborator
Author
m-kus
approved these changes
Aug 31, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improvements:
ctx.fire_hook(from hadlers or by DupDup) or by scheduler (jobsconfig section). Optionally typed withargs. Jobs are now schedules for hooks.SQL hooks.
hooks/callback.sqldirectory next tohooks/callback.py. Both Python and SQL hooks are always fired (but not nescessary non-empty). Executed byCallbackManager.Built-in hooks defined declaratively in config.
Unified codegen based on a single template for all callbacks. Config section must implement
CallbackMixin.Unified callbacks processing in
CallbackManager. Optional dynamic type-checking of arguments (basic types and dotted notations, skipped for handlers).All above finally apply to big_map indexes, debt closed.
Massive refactoring of
dipdup.configmodule. Easier to understand stages of complex config initialization flow.Callback-specific context classes removed. Callbacks receive either
HandlerContextorHookContext. Required context created in base context.Matching Websocket data with cached head block.
Bunch of internal models:
Schema: just hashIndex: status, template, template values, full configHead: last Websocket connection statusContract: hack to keep dynamically spawned contracts after restart (ignored if presented in config)No more "temporary states"!
See edge cases in TODO.
models.Head. More on int.models below.TODO:
on_rollbackhook is not implementedParentMixingenericONESHOTstatus on completehooks: List[HookConfig]? Nownamemust be equal tocallback.