-
Notifications
You must be signed in to change notification settings - Fork 46
iproto: support feature push #247
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
iproto: support feature push #247
Conversation
In the Lua API |
9663a63
to
df17542
Compare
I have updated the solution and description in PR. Now it is possible to use callback, which will be called streaming when out-of-band messages are received before the end of the main call (for example, the end of |
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.
Thank you for your draft!
I think we may implement push in a way even more similar to Lua one and describe basic cases with tests and small examples. Rework should be relatively small.
df17542
to
cbbe900
Compare
Thank you for your feedback! If the current version of the draft is suitable, I will start writing tests and documentation |
cbbe900
to
43b2142
Compare
I think it is. To fix docs build, I recommend you to rebase on master branch. Moreover, I think it's better to rebase on yet unmerged #251 since it contains fixes for potential test fails. |
43b2142
to
25ae979
Compare
f999db7
to
c237b8e
Compare
c237b8e
to
8b6c5c6
Compare
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.
Thank you for your PR! I have left several comments. If there is any questions about test infrastructure (currently it's a mess) or doc (it should be in shape after last PRs), feel free to ask me.
8cfa4cc
to
57c9055
Compare
Sorry, it seems that you'll need to rebase one more time. I think it's would be the last time and your PR would be merged next. Master changes that are relevant to you: now ConnectionPool is supported on Python 3.6 and you don't need to skip tests anymore. |
57c9055
to
5d63f52
Compare
Thank you for your feedback! I tried to answer all the comments on the code review |
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.
I've try to read the current version once more tomorrow together with examining the complicated case of schema reload with push.
6d4a20e
to
87f2bc0
Compare
87f2bc0
to
6c7ae28
Compare
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.
Thank you for your updates. I think this is the last round of comments.
Please, add the CHANGELOG entry (sorry for not having a convenient PR checklist yet).
6c7ae28
to
e366e46
Compare
Adds support for receiving out-of-band messages from server that uses box.session.push call. Data obtaining is implemented for methods: `call`, `eval`, `select`, `insert`, `replace`, `update`, `upsert`, `delete`. To do this, optional arguments `on_push` and `on_push_ctx` are used for these methods. Argument `on_push` sets the callback to call when an out-of-band message is received, and the `on_push_ctx` argument allows to save the result of `on_push` work or pass data to it. So the API is similar to the implementation of LUA version at the moment. Closes #201
e366e46
to
64f2b0d
Compare
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.
Thank you!
Adds support for receiving out-of-band messages from a server that uses box.session.push call.
Implemented for methods:
call
,eval
,select
,insert
,replace
,update
,upsert
,delete
.To work with out-of-band messages, 2 new optional arguments are used:
on_push
[function] - callback, launched with the received data for each out-of-band message. Two arguments for this callback are expected:on_push_ctx
, variable for recording the result of the callback work.on_push_ctx
- result of theon_push
work can be written to this variable.Below is an example of the proposed API with method
call
andinsert
. In the described example, before the end of thecall
andinsert
, out-of-band messages are processed via specified callback.For comparison: implementation in the lua version.
Closes #201