Closed GRISHNOV closed 1 year ago
In the Lua API on_push
is a callback (called at receiving of a pushed value) and on_push_ctx
is a value to pass to the callback (context). As I see from the PR description, here the API is different: pushed values are just stored in a provided collection. One can't instantly react on a push using a code during a long request. Is it intentional?
In the Lua API
on_push
is a callback (called at receiving of a pushed value) andon_push_ctx
is a value to pass to the callback (context). As I see from the PR description, here the API is different: pushed values are just stored in a provided collection. One can't instantly react on a push using a code during a long request. Is it intentional?
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 call
or eval
).
Thank you for your feedback! If the current version of the draft is suitable, I will start writing tests and documentation
If the current version of the draft is suitable,
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 https://github.com/tarantool/tarantool-python/pull/251 since it contains fixes for potential test fails.
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.
Thank you for your feedback! I tried to answer all the comments on the code review
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