aioodbc icon indicating copy to clipboard operation
aioodbc copied to clipboard

`Cursor.cancel()` method

Open nosklo opened this issue 6 years ago • 4 comments

Can you please add support for Cursor.cancel()?

pyodbc supports it https://github.com/mkleehammer/pyodbc/blob/45395fe723b837e836643897ff3df57034c05b22/src/cursor.cpp#L2034

nosklo avatar Jun 14 '19 23:06 nosklo

it is designed to be called from another thread, so it shouldn't use the same pool as the other commands, I believe

nosklo avatar Jun 14 '19 23:06 nosklo

I do not think pool will be an issue, since query that is executing occupies one thread, and Cursor.cancel() can be executed in other one.

jettify avatar Jun 15 '19 00:06 jettify

Would you like to submit a PR?

jettify avatar Jun 15 '19 01:06 jettify

This function's purpose is to cancel a thread, therefore, it shouldn't ever be blocked waiting for the thread it is trying to cancel. It should use a separate threadpool.

nosklo avatar Oct 04 '19 00:10 nosklo