Skip to content

Attempt to be compatible with synchronous event callbacks - #703

Draft
wwwjfy wants to merge 1 commit into
python-gino:masterfrom
wwwjfy:async-event
Draft

Attempt to be compatible with synchronous event callbacks#703
wwwjfy wants to merge 1 commit into
python-gino:masterfrom
wwwjfy:async-event

Conversation

@wwwjfy

@wwwjfywwwjfy commented Jun 20, 2020

Copy link
Copy Markdown
Member

based on #702, refs #691, a hacky fix

Honestly, Gino doesn't have to support table creation/deletion, as this can go farther, like requests of async version of Alembic, though it can be done in another package.

@wwwjfy
wwwjfy marked this pull request as draft June 21, 2020 15:21
@fantix

Copy link
Copy Markdown
Member

Right - the schema.py will be completely removed in GINO 1.4, replaced by a very simple bridge:

gino/src/gino/api.py

Lines 213 to 227 in 8c888bd

classGinoSchemaVisitor:
__slots__= ("_item",)
def__init__(self, item):
self._item=item
def__getattr__(self, item):
sync_func=getattr(self._item, item)
asyncdef_wrapper(bind=None, *args, **kwargs):
ifbindisNone:
bind=_bind_or_error(self._item)
returnawaitbind.run_sync(sync_func, *args, **kwargs)
return_wrapper

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@wwwjfy@fantix