File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import asyncio
22import cx_Oracle as csor
3+ import platform
34from concurrent .futures import ThreadPoolExecutor
45
56class AsyncCursorWarper :
@@ -87,7 +88,14 @@ def _test():
8788
8889 Issue if you have better implementation.
8990 '''
90- self ._thread_pool = ThreadPoolExecutor ()
91+ pltfm = platform .system ()
92+ if pltfm == 'Windows' :
93+ _t_num = 512
94+ elif pltfm == 'Linux' :
95+ _t_num = 1024
96+ else :
97+ raise RuntimeError ("We havent decided how many threads should acquire on your platform. Maybe you have to modify source code your self." )
98+ self ._thread_pool = ThreadPoolExecutor (max_workers = _t_num )
9199 self ._loop = loop
92100 self ._pool = pool
93101
@@ -114,4 +122,4 @@ async def __test():
114122 ...
115123
116124if __name__ == '__main__' :
117- asyncio .run (__test ())
125+ asyncio .run (__test ())
You can’t perform that action at this time.
0 commit comments