winloop 0.1.1__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- winloop-0.1.8/.flake8 +8 -0
- winloop-0.1.8/MANIFEST.in +9 -0
- winloop-0.1.8/Makefile +55 -0
- {winloop-0.1.1/winloop.egg-info → winloop-0.1.8}/PKG-INFO +87 -50
- {winloop-0.1.1 → winloop-0.1.8}/README.md +52 -41
- winloop-0.1.8/examples/bench/echoclient.py +100 -0
- winloop-0.1.8/examples/bench/echoserver.py +212 -0
- winloop-0.1.8/examples/bench/rlserver.py +93 -0
- winloop-0.1.8/mypy.ini +6 -0
- winloop-0.1.8/pyproject.toml +81 -0
- winloop-0.1.8/setup.py +298 -0
- winloop-0.1.8/tests/__init__.py +0 -0
- winloop-0.1.8/tests/__main__.py +16 -0
- winloop-0.1.8/tests/certs/ssl_cert.pem +34 -0
- winloop-0.1.8/tests/certs/ssl_key.pem +40 -0
- winloop-0.1.8/tests/test_aiodns.py +45 -0
- winloop-0.1.8/tests/test_aiohttp.py +137 -0
- winloop-0.1.8/tests/test_aiomultiprocess.py +60 -0
- winloop-0.1.8/tests/test_base.py +958 -0
- winloop-0.1.8/tests/test_context.py +791 -0
- winloop-0.1.8/tests/test_cython.py +35 -0
- winloop-0.1.8/tests/test_dealloc.py +61 -0
- winloop-0.1.8/tests/test_dns.py +279 -0
- winloop-0.1.8/tests/test_executors.py +47 -0
- winloop-0.1.8/tests/test_fs_event.py +105 -0
- winloop-0.1.8/tests/test_libuv_api.py +23 -0
- winloop-0.1.8/tests/test_pipes.py +304 -0
- winloop-0.1.8/tests/test_playwright.py +38 -0
- winloop-0.1.8/tests/test_process.py +1049 -0
- winloop-0.1.8/tests/test_process_spawning.py +115 -0
- winloop-0.1.8/tests/test_regr1.py +120 -0
- winloop-0.1.8/tests/test_runner.py +39 -0
- winloop-0.1.8/tests/test_signals.py +470 -0
- winloop-0.1.8/tests/test_sockets.py +767 -0
- winloop-0.1.8/tests/test_sourcecode.py +72 -0
- winloop-0.1.8/tests/test_tcp.py +3225 -0
- winloop-0.1.8/tests/test_testbase.py +51 -0
- winloop-0.1.8/tests/test_udp.py +414 -0
- winloop-0.1.8/tests/test_unix.py +708 -0
- winloop-0.1.8/vendor/libuv/.git +1 -0
- winloop-0.1.8/vendor/libuv/.gitattributes +1 -0
- winloop-0.1.8/vendor/libuv/.github/ISSUE_TEMPLATE.md +13 -0
- winloop-0.1.8/vendor/libuv/.github/dependabot.yml +7 -0
- winloop-0.1.8/vendor/libuv/.github/workflows/CI-docs.yml +25 -0
- winloop-0.1.8/vendor/libuv/.github/workflows/CI-sample.yml +33 -0
- winloop-0.1.8/vendor/libuv/.github/workflows/CI-unix.yml +179 -0
- winloop-0.1.8/vendor/libuv/.github/workflows/CI-win.yml +129 -0
- winloop-0.1.8/vendor/libuv/.github/workflows/sanitizer.yml +128 -0
- winloop-0.1.8/vendor/libuv/.gitignore +80 -0
- winloop-0.1.8/vendor/libuv/.mailmap +70 -0
- winloop-0.1.8/vendor/libuv/.readthedocs.yaml +15 -0
- winloop-0.1.8/vendor/libuv/AUTHORS +592 -0
- winloop-0.1.8/vendor/libuv/CMakeLists.txt +813 -0
- winloop-0.1.8/vendor/libuv/CONTRIBUTING.md +171 -0
- winloop-0.1.8/vendor/libuv/ChangeLog +6351 -0
- winloop-0.1.8/vendor/libuv/LICENSE +19 -0
- winloop-0.1.8/vendor/libuv/LICENSE-docs +396 -0
- winloop-0.1.8/vendor/libuv/LICENSE-extra +36 -0
- winloop-0.1.8/vendor/libuv/LINKS.md +109 -0
- winloop-0.1.8/vendor/libuv/MAINTAINERS.md +56 -0
- winloop-0.1.8/vendor/libuv/Makefile.am +561 -0
- winloop-0.1.8/vendor/libuv/README.md +357 -0
- winloop-0.1.8/vendor/libuv/SECURITY.md +27 -0
- winloop-0.1.8/vendor/libuv/SUPPORTED_PLATFORMS.md +68 -0
- winloop-0.1.8/vendor/libuv/autogen.sh +75 -0
- winloop-0.1.8/vendor/libuv/cmake-toolchains/cross-mingw32.cmake +17 -0
- winloop-0.1.8/vendor/libuv/configure.ac +92 -0
- winloop-0.1.8/vendor/libuv/include/uv/aix.h +32 -0
- winloop-0.1.8/vendor/libuv/include/uv/bsd.h +34 -0
- winloop-0.1.8/vendor/libuv/include/uv/darwin.h +61 -0
- winloop-0.1.8/vendor/libuv/include/uv/errno.h +477 -0
- winloop-0.1.8/vendor/libuv/include/uv/linux.h +34 -0
- winloop-0.1.8/vendor/libuv/include/uv/os390.h +33 -0
- winloop-0.1.8/vendor/libuv/include/uv/posix.h +31 -0
- winloop-0.1.8/vendor/libuv/include/uv/sunos.h +44 -0
- winloop-0.1.8/vendor/libuv/include/uv/threadpool.h +37 -0
- winloop-0.1.8/vendor/libuv/include/uv/tree.h +521 -0
- winloop-0.1.8/vendor/libuv/include/uv/unix.h +509 -0
- winloop-0.1.8/vendor/libuv/include/uv/version.h +43 -0
- winloop-0.1.8/vendor/libuv/include/uv/win.h +703 -0
- winloop-0.1.8/vendor/libuv/include/uv.h +1970 -0
- winloop-0.1.8/vendor/libuv/libuv-static.pc.in +12 -0
- winloop-0.1.8/vendor/libuv/libuv.pc.in +13 -0
- winloop-0.1.8/vendor/libuv/m4/.gitignore +5 -0
- winloop-0.1.8/vendor/libuv/m4/as_case.m4 +21 -0
- winloop-0.1.8/vendor/libuv/m4/ax_pthread.m4 +485 -0
- winloop-0.1.8/vendor/libuv/m4/libuv-check-flags.m4 +336 -0
- winloop-0.1.8/vendor/libuv/m4/libuv-check-versions.m4 +7 -0
- winloop-0.1.8/vendor/libuv/src/fs-poll.c +287 -0
- winloop-0.1.8/vendor/libuv/src/heap-inl.h +245 -0
- winloop-0.1.8/vendor/libuv/src/idna.c +560 -0
- winloop-0.1.8/vendor/libuv/src/idna.h +31 -0
- winloop-0.1.8/vendor/libuv/src/inet.c +298 -0
- winloop-0.1.8/vendor/libuv/src/queue.h +90 -0
- winloop-0.1.8/vendor/libuv/src/random.c +123 -0
- winloop-0.1.8/vendor/libuv/src/strscpy.c +38 -0
- winloop-0.1.8/vendor/libuv/src/strscpy.h +39 -0
- winloop-0.1.8/vendor/libuv/src/strtok.c +52 -0
- winloop-0.1.8/vendor/libuv/src/strtok.h +27 -0
- winloop-0.1.8/vendor/libuv/src/thread-common.c +175 -0
- winloop-0.1.8/vendor/libuv/src/threadpool.c +418 -0
- winloop-0.1.8/vendor/libuv/src/timer.c +200 -0
- winloop-0.1.8/vendor/libuv/src/unix/aix-common.c +89 -0
- winloop-0.1.8/vendor/libuv/src/unix/aix.c +1320 -0
- winloop-0.1.8/vendor/libuv/src/unix/async.c +329 -0
- winloop-0.1.8/vendor/libuv/src/unix/bsd-ifaddrs.c +163 -0
- winloop-0.1.8/vendor/libuv/src/unix/bsd-proctitle.c +99 -0
- winloop-0.1.8/vendor/libuv/src/unix/core.c +2038 -0
- winloop-0.1.8/vendor/libuv/src/unix/cygwin.c +93 -0
- winloop-0.1.8/vendor/libuv/src/unix/darwin-proctitle.c +192 -0
- winloop-0.1.8/vendor/libuv/src/unix/darwin-stub.h +97 -0
- winloop-0.1.8/vendor/libuv/src/unix/darwin-syscalls.h +17 -0
- winloop-0.1.8/vendor/libuv/src/unix/darwin.c +237 -0
- winloop-0.1.8/vendor/libuv/src/unix/dl.c +80 -0
- winloop-0.1.8/vendor/libuv/src/unix/freebsd.c +290 -0
- winloop-0.1.8/vendor/libuv/src/unix/fs.c +2319 -0
- winloop-0.1.8/vendor/libuv/src/unix/fsevents.c +906 -0
- winloop-0.1.8/vendor/libuv/src/unix/getaddrinfo.c +252 -0
- winloop-0.1.8/vendor/libuv/src/unix/getnameinfo.c +121 -0
- winloop-0.1.8/vendor/libuv/src/unix/haiku.c +172 -0
- winloop-0.1.8/vendor/libuv/src/unix/hurd.c +172 -0
- winloop-0.1.8/vendor/libuv/src/unix/ibmi.c +542 -0
- winloop-0.1.8/vendor/libuv/src/unix/internal.h +507 -0
- winloop-0.1.8/vendor/libuv/src/unix/kqueue.c +657 -0
- winloop-0.1.8/vendor/libuv/src/unix/linux.c +2708 -0
- winloop-0.1.8/vendor/libuv/src/unix/loop-watcher.c +68 -0
- winloop-0.1.8/vendor/libuv/src/unix/loop.c +236 -0
- winloop-0.1.8/vendor/libuv/src/unix/netbsd.c +264 -0
- winloop-0.1.8/vendor/libuv/src/unix/no-fsevents.c +42 -0
- winloop-0.1.8/vendor/libuv/src/unix/no-proctitle.c +45 -0
- winloop-0.1.8/vendor/libuv/src/unix/openbsd.c +245 -0
- winloop-0.1.8/vendor/libuv/src/unix/os390-proctitle.c +136 -0
- winloop-0.1.8/vendor/libuv/src/unix/os390-syscalls.c +536 -0
- winloop-0.1.8/vendor/libuv/src/unix/os390-syscalls.h +75 -0
- winloop-0.1.8/vendor/libuv/src/unix/os390.c +1070 -0
- winloop-0.1.8/vendor/libuv/src/unix/pipe.c +557 -0
- winloop-0.1.8/vendor/libuv/src/unix/poll.c +160 -0
- winloop-0.1.8/vendor/libuv/src/unix/posix-hrtime.c +36 -0
- winloop-0.1.8/vendor/libuv/src/unix/posix-poll.c +385 -0
- winloop-0.1.8/vendor/libuv/src/unix/process.c +1110 -0
- winloop-0.1.8/vendor/libuv/src/unix/procfs-exepath.c +45 -0
- winloop-0.1.8/vendor/libuv/src/unix/proctitle.c +157 -0
- winloop-0.1.8/vendor/libuv/src/unix/qnx.c +142 -0
- winloop-0.1.8/vendor/libuv/src/unix/random-devurandom.c +93 -0
- winloop-0.1.8/vendor/libuv/src/unix/random-getentropy.c +57 -0
- winloop-0.1.8/vendor/libuv/src/unix/random-getrandom.c +86 -0
- winloop-0.1.8/vendor/libuv/src/unix/random-sysctl-linux.c +99 -0
- winloop-0.1.8/vendor/libuv/src/unix/signal.c +575 -0
- winloop-0.1.8/vendor/libuv/src/unix/stream.c +1567 -0
- winloop-0.1.8/vendor/libuv/src/unix/sunos.c +907 -0
- winloop-0.1.8/vendor/libuv/src/unix/sysinfo-loadavg.c +36 -0
- winloop-0.1.8/vendor/libuv/src/unix/sysinfo-memory.c +42 -0
- winloop-0.1.8/vendor/libuv/src/unix/tcp.c +673 -0
- winloop-0.1.8/vendor/libuv/src/unix/thread.c +877 -0
- winloop-0.1.8/vendor/libuv/src/unix/tty.c +503 -0
- winloop-0.1.8/vendor/libuv/src/unix/udp.c +1403 -0
- winloop-0.1.8/vendor/libuv/src/uv-common.c +1029 -0
- winloop-0.1.8/vendor/libuv/src/uv-common.h +431 -0
- winloop-0.1.8/vendor/libuv/src/uv-data-getter-setters.c +119 -0
- winloop-0.1.8/vendor/libuv/src/version.c +45 -0
- winloop-0.1.8/vendor/libuv/src/win/async.c +98 -0
- winloop-0.1.8/vendor/libuv/src/win/atomicops-inl.h +61 -0
- winloop-0.1.8/vendor/libuv/src/win/core.c +777 -0
- winloop-0.1.8/vendor/libuv/src/win/detect-wakeup.c +56 -0
- winloop-0.1.8/vendor/libuv/src/win/dl.c +135 -0
- winloop-0.1.8/vendor/libuv/src/win/error.c +183 -0
- winloop-0.1.8/vendor/libuv/src/win/fs-event.c +616 -0
- winloop-0.1.8/vendor/libuv/src/win/fs-fd-hash-inl.h +200 -0
- winloop-0.1.8/vendor/libuv/src/win/fs.c +3570 -0
- winloop-0.1.8/vendor/libuv/src/win/getaddrinfo.c +388 -0
- winloop-0.1.8/vendor/libuv/src/win/getnameinfo.c +146 -0
- winloop-0.1.8/vendor/libuv/src/win/handle-inl.h +180 -0
- winloop-0.1.8/vendor/libuv/src/win/handle.c +162 -0
- winloop-0.1.8/vendor/libuv/src/win/internal.h +335 -0
- winloop-0.1.8/vendor/libuv/src/win/loop-watcher.c +122 -0
- winloop-0.1.8/vendor/libuv/src/win/pipe.c +2719 -0
- winloop-0.1.8/vendor/libuv/src/win/poll.c +586 -0
- winloop-0.1.8/vendor/libuv/src/win/process-stdio.c +419 -0
- winloop-0.1.8/vendor/libuv/src/win/process.c +1397 -0
- winloop-0.1.8/vendor/libuv/src/win/req-inl.h +214 -0
- winloop-0.1.8/vendor/libuv/src/win/signal.c +282 -0
- winloop-0.1.8/vendor/libuv/src/win/snprintf.c +42 -0
- winloop-0.1.8/vendor/libuv/src/win/stream-inl.h +54 -0
- winloop-0.1.8/vendor/libuv/src/win/stream.c +252 -0
- winloop-0.1.8/vendor/libuv/src/win/tcp.c +1674 -0
- winloop-0.1.8/vendor/libuv/src/win/thread.c +470 -0
- winloop-0.1.8/vendor/libuv/src/win/tty.c +2422 -0
- winloop-0.1.8/vendor/libuv/src/win/udp.c +1143 -0
- winloop-0.1.8/vendor/libuv/src/win/util.c +1703 -0
- winloop-0.1.8/vendor/libuv/src/win/winapi.c +157 -0
- winloop-0.1.8/vendor/libuv/src/win/winapi.h +4840 -0
- winloop-0.1.8/vendor/libuv/src/win/winsock.c +575 -0
- winloop-0.1.8/vendor/libuv/src/win/winsock.h +201 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-async-pummel.c +120 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-async.c +142 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-fs-stat.c +138 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-getaddrinfo.c +92 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-list.h +173 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-loop-count.c +134 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-million-async.c +113 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-million-timers.c +86 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-multi-accept.c +451 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-ping-pongs.c +221 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-ping-udp.c +169 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-pound.c +351 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-pump.c +478 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-queue-work.c +71 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-sizes.c +46 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-spawn.c +164 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-tcp-write-batch.c +144 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-thread.c +64 -0
- winloop-0.1.8/vendor/libuv/test/benchmark-udp-pummel.c +243 -0
- winloop-0.1.8/vendor/libuv/test/blackhole-server.c +122 -0
- winloop-0.1.8/vendor/libuv/test/echo-server.c +431 -0
- winloop-0.1.8/vendor/libuv/test/fixtures/empty_file +0 -0
- winloop-0.1.8/vendor/libuv/test/fixtures/load_error.node +1 -0
- winloop-0.1.8/vendor/libuv/test/fixtures/lorem_ipsum.txt +1 -0
- winloop-0.1.8/vendor/libuv/test/fixtures/one_file/one_file +0 -0
- winloop-0.1.8/vendor/libuv/test/run-benchmarks.c +72 -0
- winloop-0.1.8/vendor/libuv/test/run-tests.c +269 -0
- winloop-0.1.8/vendor/libuv/test/runner-unix.c +456 -0
- winloop-0.1.8/vendor/libuv/test/runner-unix.h +36 -0
- winloop-0.1.8/vendor/libuv/test/runner-win.c +346 -0
- winloop-0.1.8/vendor/libuv/test/runner-win.h +41 -0
- winloop-0.1.8/vendor/libuv/test/runner.c +435 -0
- winloop-0.1.8/vendor/libuv/test/runner.h +172 -0
- winloop-0.1.8/vendor/libuv/test/task.h +388 -0
- winloop-0.1.8/vendor/libuv/test/test-active.c +84 -0
- winloop-0.1.8/vendor/libuv/test/test-async-null-cb.c +64 -0
- winloop-0.1.8/vendor/libuv/test/test-async.c +134 -0
- winloop-0.1.8/vendor/libuv/test/test-barrier.c +160 -0
- winloop-0.1.8/vendor/libuv/test/test-callback-stack.c +209 -0
- winloop-0.1.8/vendor/libuv/test/test-close-fd.c +84 -0
- winloop-0.1.8/vendor/libuv/test/test-close-order.c +80 -0
- winloop-0.1.8/vendor/libuv/test/test-condvar.c +248 -0
- winloop-0.1.8/vendor/libuv/test/test-connect-unspecified.c +64 -0
- winloop-0.1.8/vendor/libuv/test/test-connection-fail.c +161 -0
- winloop-0.1.8/vendor/libuv/test/test-cwd-and-chdir.c +57 -0
- winloop-0.1.8/vendor/libuv/test/test-default-loop-close.c +58 -0
- winloop-0.1.8/vendor/libuv/test/test-delayed-accept.c +189 -0
- winloop-0.1.8/vendor/libuv/test/test-dlerror.c +65 -0
- winloop-0.1.8/vendor/libuv/test/test-eintr-handling.c +96 -0
- winloop-0.1.8/vendor/libuv/test/test-embed.c +79 -0
- winloop-0.1.8/vendor/libuv/test/test-emfile.c +129 -0
- winloop-0.1.8/vendor/libuv/test/test-env-vars.c +178 -0
- winloop-0.1.8/vendor/libuv/test/test-error.c +82 -0
- winloop-0.1.8/vendor/libuv/test/test-fail-always.c +29 -0
- winloop-0.1.8/vendor/libuv/test/test-fork.c +769 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-copyfile.c +232 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-event.c +1213 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-fd-hash.c +133 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-open-flags.c +435 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-poll.c +292 -0
- winloop-0.1.8/vendor/libuv/test/test-fs-readdir.c +548 -0
- winloop-0.1.8/vendor/libuv/test/test-fs.c +4687 -0
- winloop-0.1.8/vendor/libuv/test/test-get-currentexe.c +109 -0
- winloop-0.1.8/vendor/libuv/test/test-get-loadavg.c +35 -0
- winloop-0.1.8/vendor/libuv/test/test-get-memory.c +53 -0
- winloop-0.1.8/vendor/libuv/test/test-get-passwd.c +211 -0
- winloop-0.1.8/vendor/libuv/test/test-getaddrinfo.c +215 -0
- winloop-0.1.8/vendor/libuv/test/test-gethostname.c +58 -0
- winloop-0.1.8/vendor/libuv/test/test-getnameinfo.c +116 -0
- winloop-0.1.8/vendor/libuv/test/test-getsockname.c +362 -0
- winloop-0.1.8/vendor/libuv/test/test-getters-setters.c +114 -0
- winloop-0.1.8/vendor/libuv/test/test-gettimeofday.c +39 -0
- winloop-0.1.8/vendor/libuv/test/test-handle-fileno.c +125 -0
- winloop-0.1.8/vendor/libuv/test/test-homedir.c +81 -0
- winloop-0.1.8/vendor/libuv/test/test-hrtime.c +65 -0
- winloop-0.1.8/vendor/libuv/test/test-idle.c +125 -0
- winloop-0.1.8/vendor/libuv/test/test-idna.c +220 -0
- winloop-0.1.8/vendor/libuv/test/test-iouring-pollhup.c +111 -0
- winloop-0.1.8/vendor/libuv/test/test-ip-name.c +65 -0
- winloop-0.1.8/vendor/libuv/test/test-ip4-addr.c +55 -0
- winloop-0.1.8/vendor/libuv/test/test-ip6-addr.c +175 -0
- winloop-0.1.8/vendor/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
- winloop-0.1.8/vendor/libuv/test/test-ipc-send-recv.c +435 -0
- winloop-0.1.8/vendor/libuv/test/test-ipc.c +857 -0
- winloop-0.1.8/vendor/libuv/test/test-list.h +1253 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-alive.c +68 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-close.c +77 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-configure.c +38 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-handles.c +337 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-stop.c +83 -0
- winloop-0.1.8/vendor/libuv/test/test-loop-time.c +69 -0
- winloop-0.1.8/vendor/libuv/test/test-metrics.c +390 -0
- winloop-0.1.8/vendor/libuv/test/test-multiple-listen.c +109 -0
- winloop-0.1.8/vendor/libuv/test/test-mutexes.c +182 -0
- winloop-0.1.8/vendor/libuv/test/test-not-readable-nor-writable-on-read-error.c +104 -0
- winloop-0.1.8/vendor/libuv/test/test-not-writable-after-shutdown.c +69 -0
- winloop-0.1.8/vendor/libuv/test/test-osx-select.c +140 -0
- winloop-0.1.8/vendor/libuv/test/test-pass-always.c +28 -0
- winloop-0.1.8/vendor/libuv/test/test-ping-pong.c +439 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-bind-error.c +215 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-close-stdout-read-stdin.c +122 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-connect-error.c +97 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-connect-multiple.c +178 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-connect-prepare.c +83 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-getsockname.c +361 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-pending-instances.c +59 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-sendmsg.c +172 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-server-close.c +94 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-set-fchmod.c +92 -0
- winloop-0.1.8/vendor/libuv/test/test-pipe-set-non-blocking.c +131 -0
- winloop-0.1.8/vendor/libuv/test/test-platform-output.c +240 -0
- winloop-0.1.8/vendor/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
- winloop-0.1.8/vendor/libuv/test/test-poll-close.c +73 -0
- winloop-0.1.8/vendor/libuv/test/test-poll-closesocket.c +92 -0
- winloop-0.1.8/vendor/libuv/test/test-poll-multiple-handles.c +104 -0
- winloop-0.1.8/vendor/libuv/test/test-poll-oob.c +214 -0
- winloop-0.1.8/vendor/libuv/test/test-poll.c +730 -0
- winloop-0.1.8/vendor/libuv/test/test-process-priority.c +83 -0
- winloop-0.1.8/vendor/libuv/test/test-process-title-threadsafe.c +108 -0
- winloop-0.1.8/vendor/libuv/test/test-process-title.c +135 -0
- winloop-0.1.8/vendor/libuv/test/test-queue-foreach-delete.c +205 -0
- winloop-0.1.8/vendor/libuv/test/test-random.c +94 -0
- winloop-0.1.8/vendor/libuv/test/test-readable-on-eof.c +110 -0
- winloop-0.1.8/vendor/libuv/test/test-ref.c +445 -0
- winloop-0.1.8/vendor/libuv/test/test-run-nowait.c +46 -0
- winloop-0.1.8/vendor/libuv/test/test-run-once.c +48 -0
- winloop-0.1.8/vendor/libuv/test/test-semaphore.c +111 -0
- winloop-0.1.8/vendor/libuv/test/test-shutdown-close.c +108 -0
- winloop-0.1.8/vendor/libuv/test/test-shutdown-eof.c +188 -0
- winloop-0.1.8/vendor/libuv/test/test-shutdown-simultaneous.c +135 -0
- winloop-0.1.8/vendor/libuv/test/test-shutdown-twice.c +85 -0
- winloop-0.1.8/vendor/libuv/test/test-signal-multiple-loops.c +325 -0
- winloop-0.1.8/vendor/libuv/test/test-signal-pending-on-close.c +116 -0
- winloop-0.1.8/vendor/libuv/test/test-signal.c +325 -0
- winloop-0.1.8/vendor/libuv/test/test-socket-buffer-size.c +77 -0
- winloop-0.1.8/vendor/libuv/test/test-spawn.c +2114 -0
- winloop-0.1.8/vendor/libuv/test/test-stdio-over-pipes.c +299 -0
- winloop-0.1.8/vendor/libuv/test/test-strscpy.c +53 -0
- winloop-0.1.8/vendor/libuv/test/test-strtok.c +90 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-bind-error.c +317 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-bind6-error.c +176 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-close-accept.c +198 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-close-after-read-timeout.c +183 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-close-reset.c +340 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-close-while-connecting.c +97 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-close.c +136 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-connect-error-after-write.c +98 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-connect-error.c +73 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-connect-timeout.c +196 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-connect6-error.c +129 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-create-socket-early.c +213 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-flags.c +59 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-oob.c +146 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-open.c +407 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-read-stop-start.c +136 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-read-stop.c +76 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-reuseport.c +248 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-rst.c +110 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-shutdown-after-write.c +138 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-try-write-error.c +109 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-try-write.c +135 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-unexpected-read.c +117 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-write-after-connect.c +77 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-write-fail.c +115 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-write-in-a-row.c +143 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-write-queue-order.c +139 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
- winloop-0.1.8/vendor/libuv/test/test-tcp-writealot.c +185 -0
- winloop-0.1.8/vendor/libuv/test/test-test-macros.c +42 -0
- winloop-0.1.8/vendor/libuv/test/test-thread-affinity.c +154 -0
- winloop-0.1.8/vendor/libuv/test/test-thread-equal.c +51 -0
- winloop-0.1.8/vendor/libuv/test/test-thread-priority.c +105 -0
- winloop-0.1.8/vendor/libuv/test/test-thread.c +296 -0
- winloop-0.1.8/vendor/libuv/test/test-threadpool-cancel.c +418 -0
- winloop-0.1.8/vendor/libuv/test/test-threadpool.c +76 -0
- winloop-0.1.8/vendor/libuv/test/test-timer-again.c +141 -0
- winloop-0.1.8/vendor/libuv/test/test-timer-from-check.c +80 -0
- winloop-0.1.8/vendor/libuv/test/test-timer.c +453 -0
- winloop-0.1.8/vendor/libuv/test/test-tmpdir.c +89 -0
- winloop-0.1.8/vendor/libuv/test/test-tty-duplicate-key.c +321 -0
- winloop-0.1.8/vendor/libuv/test/test-tty-escape-sequence-processing.c +1632 -0
- winloop-0.1.8/vendor/libuv/test/test-tty.c +468 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-alloc-cb-fail.c +196 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-bind.c +93 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-connect.c +196 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-connect6.c +199 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-create-socket-early.c +139 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-dgram-too-big.c +91 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-ipv6.c +259 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-mmsg.c +149 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-multicast-interface.c +104 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-multicast-interface6.c +108 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-multicast-join.c +184 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-multicast-join6.c +223 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-multicast-ttl.c +94 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-open.c +350 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-options.c +160 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-recv-in-a-row.c +128 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-reuseport.c +287 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-send-and-recv.c +212 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-send-hang-loop.c +99 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-send-immediate.c +148 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-send-unreachable.c +201 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-sendmmsg-error.c +75 -0
- winloop-0.1.8/vendor/libuv/test/test-udp-try-send.c +121 -0
- winloop-0.1.8/vendor/libuv/test/test-uname.c +69 -0
- winloop-0.1.8/vendor/libuv/test/test-walk-handles.c +77 -0
- winloop-0.1.8/vendor/libuv/test/test-watcher-cross-stop.c +112 -0
- winloop-0.1.8/vendor/libuv/tools/make_dist_html.py +122 -0
- winloop-0.1.8/vendor/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
- winloop-0.1.8/vendor/libuv/tsansupp.txt +2 -0
- winloop-0.1.8/vendor/libuv/uv_win_longpath.manifest +8 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop/__init__.py +21 -40
- {winloop-0.1.1 → winloop-0.1.8}/winloop/_noop.py +0 -1
- {winloop-0.1.1 → winloop-0.1.8}/winloop/_testbase.py +17 -9
- winloop-0.1.8/winloop/_version.py +13 -0
- winloop-0.1.8/winloop/cbhandles.pxd +39 -0
- winloop-0.1.8/winloop/cbhandles.pyx +434 -0
- winloop-0.1.8/winloop/dns.pyx +496 -0
- winloop-0.1.8/winloop/errors.pyx +83 -0
- winloop-0.1.8/winloop/handles/async_.pxd +11 -0
- winloop-0.1.8/winloop/handles/async_.pyx +56 -0
- winloop-0.1.8/winloop/handles/basetransport.pxd +54 -0
- winloop-0.1.8/winloop/handles/basetransport.pyx +293 -0
- winloop-0.1.8/winloop/handles/check.pxd +14 -0
- winloop-0.1.8/winloop/handles/check.pyx +72 -0
- winloop-0.1.8/winloop/handles/fsevent.pxd +12 -0
- winloop-0.1.8/winloop/handles/fsevent.pyx +116 -0
- winloop-0.1.8/winloop/handles/handle.pxd +48 -0
- winloop-0.1.8/winloop/handles/handle.pyx +395 -0
- winloop-0.1.8/winloop/handles/idle.pxd +14 -0
- winloop-0.1.8/winloop/handles/idle.pyx +72 -0
- winloop-0.1.8/winloop/handles/pipe.pxd +33 -0
- winloop-0.1.8/winloop/handles/pipe.pyx +247 -0
- winloop-0.1.8/winloop/handles/poll.pxd +25 -0
- winloop-0.1.8/winloop/handles/poll.pyx +237 -0
- winloop-0.1.8/winloop/handles/process.pxd +80 -0
- winloop-0.1.8/winloop/handles/process.pyx +844 -0
- winloop-0.1.8/winloop/handles/stream.pxd +50 -0
- winloop-0.1.8/winloop/handles/stream.pyx +1038 -0
- winloop-0.1.8/winloop/handles/streamserver.pxd +26 -0
- winloop-0.1.8/winloop/handles/streamserver.pyx +150 -0
- winloop-0.1.8/winloop/handles/tcp.pxd +26 -0
- winloop-0.1.8/winloop/handles/tcp.pyx +228 -0
- winloop-0.1.8/winloop/handles/timer.pxd +18 -0
- winloop-0.1.8/winloop/handles/timer.pyx +89 -0
- winloop-0.1.8/winloop/handles/udp.pxd +22 -0
- winloop-0.1.8/winloop/handles/udp.pyx +408 -0
- winloop-0.1.8/winloop/includes/compat.h +178 -0
- winloop-0.1.8/winloop/includes/consts.pxi +33 -0
- winloop-0.1.8/winloop/includes/debug.h +3 -0
- winloop-0.1.8/winloop/includes/debug.pxd +3 -0
- winloop-0.1.8/winloop/includes/flowcontrol.pxd +23 -0
- winloop-0.1.8/winloop/includes/fork_handler.h +56 -0
- winloop-0.1.8/winloop/includes/python.pxd +31 -0
- winloop-0.1.8/winloop/includes/stdlib.pxi +179 -0
- winloop-0.1.8/winloop/includes/system.pxd +82 -0
- winloop-0.1.8/winloop/includes/uv.pxd +517 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop/loop.c +60991 -57074
- winloop-0.1.8/winloop/loop.pxd +230 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop/loop.pyi +4 -1
- winloop-0.1.8/winloop/loop.pyx +3441 -0
- winloop-0.1.8/winloop/lru.pyx +79 -0
- winloop-0.1.8/winloop/pseudosock.pyx +209 -0
- winloop-0.1.8/winloop/py.typed +0 -0
- winloop-0.1.8/winloop/request.pxd +8 -0
- winloop-0.1.8/winloop/request.pyx +65 -0
- winloop-0.1.8/winloop/server.pxd +19 -0
- winloop-0.1.8/winloop/server.pyx +136 -0
- winloop-0.1.8/winloop/sslproto.pxd +138 -0
- winloop-0.1.8/winloop/sslproto.pyx +950 -0
- {winloop-0.1.1 → winloop-0.1.8/winloop.egg-info}/PKG-INFO +87 -50
- winloop-0.1.8/winloop.egg-info/SOURCES.txt +474 -0
- winloop-0.1.8/winloop.egg-info/not-zip-safe +1 -0
- winloop-0.1.8/winloop.egg-info/requires.txt +17 -0
- winloop-0.1.8/winloop.png +0 -0
- winloop-0.1.1/pyproject.toml +0 -9
- winloop-0.1.1/setup.py +0 -96
- winloop-0.1.1/winloop/includes/context.h +0 -38
- winloop-0.1.1/winloop.egg-info/SOURCES.txt +0 -17
- winloop-0.1.1/winloop.egg-info/requires.txt +0 -1
- {winloop-0.1.1 → winloop-0.1.8}/LICENSE-APACHE +0 -0
- {winloop-0.1.1 → winloop-0.1.8}/LICENSE-MIT +0 -0
- {winloop-0.1.1 → winloop-0.1.8}/setup.cfg +0 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop/includes/__init__.py +0 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop.egg-info/dependency_links.txt +0 -0
- {winloop-0.1.1 → winloop-0.1.8}/winloop.egg-info/top_level.txt +0 -0
winloop-0.1.8/.flake8
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[flake8]
|
|
2
|
+
filename = *.py,*.pyi
|
|
3
|
+
ignore = E402,E731,D100,D101,D102,D103,D104,D105,W503,W504,E252
|
|
4
|
+
exclude = .git,__pycache__,build,dist,.eggs,postgres,vendor
|
|
5
|
+
|
|
6
|
+
per-file-ignores =
|
|
7
|
+
*.pyx,*.pxd,*.pxi: E211, E222, E225, E226, E227, E999
|
|
8
|
+
*.pyi: F401, F403, F405, F811, E127, E128, E203, E266, E301, E302, E305, E501, E701, E704, E741, B303, W503, W504
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
recursive-include docs *.py *.rst
|
|
2
|
+
recursive-include examples *.py
|
|
3
|
+
recursive-include tests *.py *.pem
|
|
4
|
+
recursive-include winloop *.pyx *.pxd *.pxi *.py *.c *.h *.pyi py.typed
|
|
5
|
+
recursive-include vendor/libuv *
|
|
6
|
+
recursive-exclude vendor/libuv/.git *
|
|
7
|
+
recursive-exclude vendor/libuv/docs *
|
|
8
|
+
recursive-exclude vendor/libuv/img *
|
|
9
|
+
include LICENSE-MIT LICENSE-APACHE README.md Makefile winloop.png .flake8 mypy.ini
|
winloop-0.1.8/Makefile
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.PHONY: _default clean clean-libuv distclean compile debug docs test testinstalled release setup-build ci-clean
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
PYTHON ?= python
|
|
5
|
+
ROOT = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_default: compile
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
clean:
|
|
12
|
+
rm -fr dist/ doc/_build/ *.egg-info winloop/loop.*.pyd uvloop/loop_d.*.pyd
|
|
13
|
+
rm -fr winloop/*.c winloop/*.html winloop/*.so
|
|
14
|
+
rm -fr winloop/handles/*.html winloop/includes/*.html
|
|
15
|
+
find . -name '__pycache__' | xargs rm -rf
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ci-clean: clean
|
|
19
|
+
rm -fr build/lib.* build/temp.* build/libuv
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
clean-libuv:
|
|
23
|
+
(cd vendor/libuv; git clean -dfX)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
distclean: clean clean-libuv
|
|
27
|
+
rm -fr build/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
setup-build:
|
|
31
|
+
$(PYTHON) setup.py build_ext --inplace --cython-always
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
compile: clean setup-build
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
debug: clean
|
|
38
|
+
$(PYTHON) setup.py build_ext --inplace --debug \
|
|
39
|
+
--cython-always \
|
|
40
|
+
--cython-annotate \
|
|
41
|
+
--cython-directives="linetrace=True" \
|
|
42
|
+
--define UVLOOP_DEBUG,CYTHON_TRACE,CYTHON_TRACE_NOGIL
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
docs:
|
|
46
|
+
$(PYTHON) setup.py build_ext --inplace build_sphinx
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
test:
|
|
50
|
+
PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest discover -v tests
|
|
51
|
+
$(PYTHON) -m unittest discover -v tests
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
testinstalled:
|
|
55
|
+
cd "$${HOME}" && $(PYTHON) -m unittest discover -v $(ROOT)/tests
|
|
@@ -1,48 +1,84 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: winloop
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.8
|
|
4
|
+
Summary: Windows version of uvloop
|
|
5
5
|
Author: Vizonex
|
|
6
|
-
License: MIT
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
License: MIT License
|
|
7
|
+
Project-URL: github, https://github.com/Vizonex/Winloop
|
|
8
|
+
Keywords: asyncio,networking
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Framework :: AsyncIO
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: POSIX
|
|
15
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
10
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier:
|
|
13
|
-
Classifier:
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
25
|
+
Classifier: Topic :: System :: Networking
|
|
26
|
+
Requires-Python: >=3.8.0
|
|
14
27
|
Description-Content-Type: text/markdown
|
|
15
28
|
License-File: LICENSE-APACHE
|
|
16
29
|
License-File: LICENSE-MIT
|
|
17
|
-
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: aiohttp>=3.10.5; extra == "test"
|
|
32
|
+
Requires-Dist: flake8~=5.0; extra == "test"
|
|
33
|
+
Requires-Dist: psutil; extra == "test"
|
|
34
|
+
Requires-Dist: pycodestyle~=2.9.0; extra == "test"
|
|
35
|
+
Requires-Dist: pyOpenSSL~=23.0.0; extra == "test"
|
|
36
|
+
Requires-Dist: mypy>=0.800; extra == "test"
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: setuptools>=60; extra == "dev"
|
|
39
|
+
Requires-Dist: Cython~=3.0; extra == "dev"
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: Sphinx~=4.1.2; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinxcontrib-asyncio~=0.3.0; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx_rtd_theme~=0.5.2; extra == "docs"
|
|
18
44
|
|
|
19
45
|
<img src="https://raw.githubusercontent.com/Vizonex/Winloop/main/winloop.png" width="200px"/>
|
|
46
|
+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
|
20
47
|
|
|
21
48
|
# Winloop
|
|
22
|
-
An Alternative library for uvloop
|
|
23
|
-
I never really liked the fact that I couldn't make anything run faster
|
|
49
|
+
An Alternative library for uvloop compatibility with windows because let's face it. Window's python asyncio standard library is garbage especially when Windows Defender decides to eat half of your ram.
|
|
50
|
+
I never really liked the fact that I couldn't make anything run faster especially when you have fiber internet connections in place and you've done all the optimizations you could possibly think of. It always felt disappointing when `libuv` is available for windows [but windows was never compatible with uvloop.](https://github.com/MagicStack/uvloop/issues/14#issuecomment-575826367])
|
|
24
51
|
|
|
25
|
-
Because nobody was willing to step in after so many years of
|
|
52
|
+
Because nobody was willing to step in after so many years of waiting, I went ahead and downloaded the source code for uvloop and started modifying the source code to be windows compatible by carefully removing and changing parts that were not made for windows. Many hours of research went into making this library exist.
|
|
26
53
|
|
|
27
|
-
The differences with __uvloop__ is that forking has been fully disabled and some smaller api calls had to be changed
|
|
54
|
+
The differences with __uvloop__ is that forking has been fully disabled and some smaller api calls had to be changed, error handling has been carefully modified and subprocesses instead release the gil instead of forking out...
|
|
28
55
|
|
|
56
|
+
There is a performance increase of about 5 times vs using the `WindowsSelectorEventLoopPolicy` and `WindowsProactorEventLoopPolicy` which have been known to trigger ssl problems in `python 3.9`. Winloop is a very good replacement for solving those ssl problems as well. This library also has comparable performance to it's brother uvloop.
|
|
29
57
|
|
|
30
|
-
There is a perfromance increase of about 5 times vs using the `WindowsSelectorEventLoopPolicy` and `WindowsProactorEventLoopPolicy` which have been known to trigger ssl problems in python 3.9. Winloop is a very good replacement for those ssl problem as well.
|
|
31
58
|
|
|
32
59
|
|
|
33
|
-
## How to install Winloop on your Operating System
|
|
60
|
+
## How to install Winloop on your Windows Operating System
|
|
34
61
|
|
|
35
62
|
```
|
|
36
63
|
pip install winloop
|
|
37
64
|
```
|
|
38
65
|
|
|
39
|
-
|
|
66
|
+
You can also clone the repository and build the extension yourself by running the command below if you wish to use or build this library locally, Note that you will need Cython and The Visual C++ extensions
|
|
67
|
+
to compile this library on your own.
|
|
40
68
|
|
|
41
69
|
```
|
|
42
|
-
python setup.py build_ext --inplace
|
|
70
|
+
python setup.py build_ext --inplace
|
|
43
71
|
```
|
|
44
72
|
|
|
45
|
-
|
|
73
|
+
## Issues Reporting
|
|
74
|
+
|
|
75
|
+
If you find any bugs with this library be sure to open up an issue to our github repo. Me and other contributors will be happy try to help you figure out and diagnose your problems.
|
|
76
|
+
|
|
77
|
+
## Making pull requests
|
|
78
|
+
We encourage anyone to make pull-requests to winloop from spelling mistakes to vulnerability patches. Every little bit helps keep this library maintained and alive.
|
|
79
|
+
Make sure that you are able to compile the library with the steps shown above. We plan to implement a nightly workflow to verify one's pull request in the future.
|
|
80
|
+
|
|
81
|
+
|
|
46
82
|
|
|
47
83
|
```python
|
|
48
84
|
try:
|
|
@@ -62,7 +98,7 @@ import sys
|
|
|
62
98
|
class TestAioHTTP(unittest.TestCase):
|
|
63
99
|
def __init__(self, methodName: str = "test_aiohttp_basic_1") -> None:
|
|
64
100
|
super().__init__(methodName)
|
|
65
|
-
|
|
101
|
+
|
|
66
102
|
|
|
67
103
|
def setUp(self):
|
|
68
104
|
self.loop = asyncio.get_event_loop()
|
|
@@ -160,42 +196,43 @@ if __name__ == "__main__":
|
|
|
160
196
|
# asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy
|
|
161
197
|
# asyncio.DefaultEventLoopPolicy = asyncio.WindowsProactorEventLoopPolicy
|
|
162
198
|
unittest.main()
|
|
163
|
-
# Looks like winloop might be 3x faster than the Proctor Event Loop , THAT's A HUGE IMPROVEMENT!
|
|
199
|
+
# Looks like winloop might be 3x faster than the Proctor Event Loop , THAT's A HUGE IMPROVEMENT!
|
|
164
200
|
print("testing again but with winloop enabled")
|
|
165
201
|
winloop.install()
|
|
166
202
|
unittest.main()
|
|
167
203
|
```
|
|
168
204
|
|
|
169
|
-
The benchmarks for the code above are as follows
|
|
205
|
+
The benchmarks for the code above are as follows
|
|
170
206
|
|
|
171
207
|
## Benchmarks
|
|
172
208
|
|
|
173
|
-
### TCP Connections
|
|
209
|
+
### TCP Connections
|
|
174
210
|
-------------------
|
|
175
211
|
|
|
176
|
-
| Asyncio Event Loop Policy | Time (in Seconds) |
|
|
212
|
+
| Asyncio Event Loop Policy | Time (in Seconds) |
|
|
177
213
|
|-----------------------------------|-----------------------|
|
|
178
214
|
| WinLoopPolicy | 0.493s |
|
|
179
215
|
| WindowsProactorEventLoopPolicy | 2.510s |
|
|
180
216
|
| WindowsSelectorEventLoopPolicy | 2.723s |
|
|
181
217
|
|
|
182
218
|
|
|
183
|
-
That's a massive increase and jump from just TCP alone I'll be posting more benchmarks soon as
|
|
219
|
+
That's a massive increase and jump from just TCP alone I'll be posting more benchmarks soon as
|
|
184
220
|
I modify more of the current test suites made by uvloop...
|
|
185
221
|
|
|
186
222
|
|
|
187
|
-
## How to Use Winloop with Fastapi
|
|
223
|
+
## How to Use Winloop with Fastapi
|
|
188
224
|
|
|
189
225
|
This was a cool little script I put together Just to make fastapi that much faster to handle
|
|
190
226
|
|
|
191
227
|
```python
|
|
192
228
|
|
|
229
|
+
# TODO this code example is deprecated
|
|
193
230
|
from fastapi import FastAPI
|
|
194
231
|
from fastapi.responses import HTMLResponse
|
|
195
|
-
import winloop
|
|
232
|
+
import winloop
|
|
196
233
|
import uvicorn
|
|
197
|
-
import asyncio
|
|
198
|
-
import datetime
|
|
234
|
+
import asyncio
|
|
235
|
+
import datetime
|
|
199
236
|
|
|
200
237
|
app = FastAPI()
|
|
201
238
|
|
|
@@ -210,7 +247,7 @@ async def test_get_request():
|
|
|
210
247
|
return HTMLResponse("<html><body><h1>FAST API WORKS WITH WINLOOP!</h1></body></html>")
|
|
211
248
|
|
|
212
249
|
|
|
213
|
-
# starllete will use asyncio.to_thread() so that this can remain asynchronous
|
|
250
|
+
# starllete will use asyncio.to_thread() so that this can remain asynchronous
|
|
214
251
|
@app.get("/date")
|
|
215
252
|
def test_dynamic_response():
|
|
216
253
|
return str(datetime.datetime.now())
|
|
@@ -227,14 +264,14 @@ if __name__ == "__main__":
|
|
|
227
264
|
```
|
|
228
265
|
|
|
229
266
|
|
|
230
|
-
## How To Use Winloop When Uvloop is not
|
|
267
|
+
## How To Use Winloop When Uvloop is not available
|
|
231
268
|
|
|
232
269
|
```python
|
|
233
270
|
|
|
234
|
-
# Here's A small Example of using winloop when uvloop is not
|
|
271
|
+
# Here's A small Example of using winloop when uvloop is not available to us
|
|
235
272
|
import sys
|
|
236
273
|
import aiohttp
|
|
237
|
-
import asyncio
|
|
274
|
+
import asyncio
|
|
238
275
|
|
|
239
276
|
async def main():
|
|
240
277
|
async with aiohttp.ClientSession("https://httpbin.org") as client:
|
|
@@ -243,37 +280,37 @@ async def main():
|
|
|
243
280
|
|
|
244
281
|
if __name__ == "__main__":
|
|
245
282
|
if sys.platform in ('win32', 'cygwin', 'cli'):
|
|
246
|
-
from winloop import
|
|
283
|
+
from winloop import run
|
|
247
284
|
else:
|
|
248
285
|
# if we're on apple or linux do this instead
|
|
249
|
-
from uvloop import
|
|
250
|
-
|
|
251
|
-
asyncio.run(main())
|
|
286
|
+
from uvloop import run
|
|
287
|
+
run(main())
|
|
252
288
|
```
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
## Possible Upcomming Features/Optimizations to Winloop / This is also our TODO list
|
|
256
|
-
I have been looking deeply into some of the proposed Pulls and changes to `Uvloop` and I will be tuning in and listening to what's going on uvloop's end to see what we might have to change . This is a list of features I would like to implement from likely to least likely to be done as well as solved. If any of these feature have been added you will simply know by the fact that It won't be on this list anymore...
|
|
257
289
|
|
|
258
|
-
- Drop All `DEF` Macros, I'm currently seeking help on replacements for macros where all the variables are known about at compile-time
|
|
259
290
|
|
|
260
|
-
|
|
291
|
+
## TODO-List
|
|
292
|
+
|
|
293
|
+
- Update Fastapi Example to a more recent version of fastapi
|
|
261
294
|
|
|
262
|
-
-
|
|
295
|
+
- Contact uvicorn about this [issue](https://github.com/Vizonex/Winloop/issues/11) I have a funny feeling something is going on here...
|
|
263
296
|
|
|
264
|
-
-
|
|
297
|
+
- Nightly Builds And Test Suite Workflows for anyone wanting to use newer unreleased versions.
|
|
265
298
|
|
|
266
|
-
- Drop
|
|
299
|
+
- Drop All `DEF` Macros, I'm currently seeking help on replacements for macros where all the variables are known about at compile-time
|
|
267
300
|
|
|
268
|
-
-
|
|
301
|
+
- Adding in the necessary hooks for pyinstaller to compile this fast library to executable code even though hooks have been known to inflate the size of the `.exe` files. This is because calling hidden-imports for all the `__init__.py` modules might annoy some developers. (Luckily I'm aware of this issue because I've been doing this myself...)
|
|
269
302
|
|
|
270
|
-
-
|
|
303
|
+
- write a workflow for compiling libuv on different versions of windows when distributing out pypi wheels.
|
|
271
304
|
|
|
272
|
-
-
|
|
305
|
+
- write a workflow for nightly builds if necessary for verification of pull requests.
|
|
273
306
|
|
|
274
|
-
-
|
|
307
|
+
- Sphinx Styled Documentation (Maybe I'm thinking about it...)
|
|
275
308
|
|
|
309
|
+
- Update benchmarks (They are old) can't believe I maintained this project for over a year now...
|
|
276
310
|
|
|
277
311
|
## Videos
|
|
278
312
|
- By me: https://www.youtube.com/watch?v=tz9RYJ6aBZ8 (I might make a tutorial on how to use and install winloop it for those who have reading problems)
|
|
279
|
-
- My Presentation and Virtual Confrence: https://www.youtube.com/watch?v=Cbb6trkKWXY
|
|
313
|
+
- My Presentation and Virtual Confrence: https://www.youtube.com/watch?v=Cbb6trkKWXY
|
|
314
|
+
|
|
315
|
+
## Contributing
|
|
316
|
+
I put my heart and soul into this library ever since it began and any help is apperciated and means a lot to me.
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
<img src="https://raw.githubusercontent.com/Vizonex/Winloop/main/winloop.png" width="200px"/>
|
|
2
|
+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
|
2
3
|
|
|
3
4
|
# Winloop
|
|
4
|
-
An Alternative library for uvloop
|
|
5
|
-
I never really liked the fact that I couldn't make anything run faster
|
|
5
|
+
An Alternative library for uvloop compatibility with windows because let's face it. Window's python asyncio standard library is garbage especially when Windows Defender decides to eat half of your ram.
|
|
6
|
+
I never really liked the fact that I couldn't make anything run faster especially when you have fiber internet connections in place and you've done all the optimizations you could possibly think of. It always felt disappointing when `libuv` is available for windows [but windows was never compatible with uvloop.](https://github.com/MagicStack/uvloop/issues/14#issuecomment-575826367])
|
|
6
7
|
|
|
7
|
-
Because nobody was willing to step in after so many years of
|
|
8
|
+
Because nobody was willing to step in after so many years of waiting, I went ahead and downloaded the source code for uvloop and started modifying the source code to be windows compatible by carefully removing and changing parts that were not made for windows. Many hours of research went into making this library exist.
|
|
8
9
|
|
|
9
|
-
The differences with __uvloop__ is that forking has been fully disabled and some smaller api calls had to be changed
|
|
10
|
+
The differences with __uvloop__ is that forking has been fully disabled and some smaller api calls had to be changed, error handling has been carefully modified and subprocesses instead release the gil instead of forking out...
|
|
10
11
|
|
|
12
|
+
There is a performance increase of about 5 times vs using the `WindowsSelectorEventLoopPolicy` and `WindowsProactorEventLoopPolicy` which have been known to trigger ssl problems in `python 3.9`. Winloop is a very good replacement for solving those ssl problems as well. This library also has comparable performance to it's brother uvloop.
|
|
11
13
|
|
|
12
|
-
There is a perfromance increase of about 5 times vs using the `WindowsSelectorEventLoopPolicy` and `WindowsProactorEventLoopPolicy` which have been known to trigger ssl problems in python 3.9. Winloop is a very good replacement for those ssl problem as well.
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
## How to install Winloop on your Operating System
|
|
16
|
+
## How to install Winloop on your Windows Operating System
|
|
16
17
|
|
|
17
18
|
```
|
|
18
19
|
pip install winloop
|
|
19
20
|
```
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
You can also clone the repository and build the extension yourself by running the command below if you wish to use or build this library locally, Note that you will need Cython and The Visual C++ extensions
|
|
23
|
+
to compile this library on your own.
|
|
22
24
|
|
|
23
25
|
```
|
|
24
|
-
python setup.py build_ext --inplace
|
|
26
|
+
python setup.py build_ext --inplace
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
## Issues Reporting
|
|
30
|
+
|
|
31
|
+
If you find any bugs with this library be sure to open up an issue to our github repo. Me and other contributors will be happy try to help you figure out and diagnose your problems.
|
|
32
|
+
|
|
33
|
+
## Making pull requests
|
|
34
|
+
We encourage anyone to make pull-requests to winloop from spelling mistakes to vulnerability patches. Every little bit helps keep this library maintained and alive.
|
|
35
|
+
Make sure that you are able to compile the library with the steps shown above. We plan to implement a nightly workflow to verify one's pull request in the future.
|
|
36
|
+
|
|
37
|
+
|
|
28
38
|
|
|
29
39
|
```python
|
|
30
40
|
try:
|
|
@@ -44,7 +54,7 @@ import sys
|
|
|
44
54
|
class TestAioHTTP(unittest.TestCase):
|
|
45
55
|
def __init__(self, methodName: str = "test_aiohttp_basic_1") -> None:
|
|
46
56
|
super().__init__(methodName)
|
|
47
|
-
|
|
57
|
+
|
|
48
58
|
|
|
49
59
|
def setUp(self):
|
|
50
60
|
self.loop = asyncio.get_event_loop()
|
|
@@ -142,42 +152,43 @@ if __name__ == "__main__":
|
|
|
142
152
|
# asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy
|
|
143
153
|
# asyncio.DefaultEventLoopPolicy = asyncio.WindowsProactorEventLoopPolicy
|
|
144
154
|
unittest.main()
|
|
145
|
-
# Looks like winloop might be 3x faster than the Proctor Event Loop , THAT's A HUGE IMPROVEMENT!
|
|
155
|
+
# Looks like winloop might be 3x faster than the Proctor Event Loop , THAT's A HUGE IMPROVEMENT!
|
|
146
156
|
print("testing again but with winloop enabled")
|
|
147
157
|
winloop.install()
|
|
148
158
|
unittest.main()
|
|
149
159
|
```
|
|
150
160
|
|
|
151
|
-
The benchmarks for the code above are as follows
|
|
161
|
+
The benchmarks for the code above are as follows
|
|
152
162
|
|
|
153
163
|
## Benchmarks
|
|
154
164
|
|
|
155
|
-
### TCP Connections
|
|
165
|
+
### TCP Connections
|
|
156
166
|
-------------------
|
|
157
167
|
|
|
158
|
-
| Asyncio Event Loop Policy | Time (in Seconds) |
|
|
168
|
+
| Asyncio Event Loop Policy | Time (in Seconds) |
|
|
159
169
|
|-----------------------------------|-----------------------|
|
|
160
170
|
| WinLoopPolicy | 0.493s |
|
|
161
171
|
| WindowsProactorEventLoopPolicy | 2.510s |
|
|
162
172
|
| WindowsSelectorEventLoopPolicy | 2.723s |
|
|
163
173
|
|
|
164
174
|
|
|
165
|
-
That's a massive increase and jump from just TCP alone I'll be posting more benchmarks soon as
|
|
175
|
+
That's a massive increase and jump from just TCP alone I'll be posting more benchmarks soon as
|
|
166
176
|
I modify more of the current test suites made by uvloop...
|
|
167
177
|
|
|
168
178
|
|
|
169
|
-
## How to Use Winloop with Fastapi
|
|
179
|
+
## How to Use Winloop with Fastapi
|
|
170
180
|
|
|
171
181
|
This was a cool little script I put together Just to make fastapi that much faster to handle
|
|
172
182
|
|
|
173
183
|
```python
|
|
174
184
|
|
|
185
|
+
# TODO this code example is deprecated
|
|
175
186
|
from fastapi import FastAPI
|
|
176
187
|
from fastapi.responses import HTMLResponse
|
|
177
|
-
import winloop
|
|
188
|
+
import winloop
|
|
178
189
|
import uvicorn
|
|
179
|
-
import asyncio
|
|
180
|
-
import datetime
|
|
190
|
+
import asyncio
|
|
191
|
+
import datetime
|
|
181
192
|
|
|
182
193
|
app = FastAPI()
|
|
183
194
|
|
|
@@ -192,7 +203,7 @@ async def test_get_request():
|
|
|
192
203
|
return HTMLResponse("<html><body><h1>FAST API WORKS WITH WINLOOP!</h1></body></html>")
|
|
193
204
|
|
|
194
205
|
|
|
195
|
-
# starllete will use asyncio.to_thread() so that this can remain asynchronous
|
|
206
|
+
# starllete will use asyncio.to_thread() so that this can remain asynchronous
|
|
196
207
|
@app.get("/date")
|
|
197
208
|
def test_dynamic_response():
|
|
198
209
|
return str(datetime.datetime.now())
|
|
@@ -209,14 +220,14 @@ if __name__ == "__main__":
|
|
|
209
220
|
```
|
|
210
221
|
|
|
211
222
|
|
|
212
|
-
## How To Use Winloop When Uvloop is not
|
|
223
|
+
## How To Use Winloop When Uvloop is not available
|
|
213
224
|
|
|
214
225
|
```python
|
|
215
226
|
|
|
216
|
-
# Here's A small Example of using winloop when uvloop is not
|
|
227
|
+
# Here's A small Example of using winloop when uvloop is not available to us
|
|
217
228
|
import sys
|
|
218
229
|
import aiohttp
|
|
219
|
-
import asyncio
|
|
230
|
+
import asyncio
|
|
220
231
|
|
|
221
232
|
async def main():
|
|
222
233
|
async with aiohttp.ClientSession("https://httpbin.org") as client:
|
|
@@ -225,37 +236,37 @@ async def main():
|
|
|
225
236
|
|
|
226
237
|
if __name__ == "__main__":
|
|
227
238
|
if sys.platform in ('win32', 'cygwin', 'cli'):
|
|
228
|
-
from winloop import
|
|
239
|
+
from winloop import run
|
|
229
240
|
else:
|
|
230
241
|
# if we're on apple or linux do this instead
|
|
231
|
-
from uvloop import
|
|
232
|
-
|
|
233
|
-
asyncio.run(main())
|
|
242
|
+
from uvloop import run
|
|
243
|
+
run(main())
|
|
234
244
|
```
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
## Possible Upcomming Features/Optimizations to Winloop / This is also our TODO list
|
|
238
|
-
I have been looking deeply into some of the proposed Pulls and changes to `Uvloop` and I will be tuning in and listening to what's going on uvloop's end to see what we might have to change . This is a list of features I would like to implement from likely to least likely to be done as well as solved. If any of these feature have been added you will simply know by the fact that It won't be on this list anymore...
|
|
239
245
|
|
|
240
|
-
- Drop All `DEF` Macros, I'm currently seeking help on replacements for macros where all the variables are known about at compile-time
|
|
241
246
|
|
|
242
|
-
|
|
247
|
+
## TODO-List
|
|
243
248
|
|
|
244
|
-
-
|
|
249
|
+
- Update Fastapi Example to a more recent version of fastapi
|
|
245
250
|
|
|
246
|
-
-
|
|
251
|
+
- Contact uvicorn about this [issue](https://github.com/Vizonex/Winloop/issues/11) I have a funny feeling something is going on here...
|
|
247
252
|
|
|
248
|
-
-
|
|
253
|
+
- Nightly Builds And Test Suite Workflows for anyone wanting to use newer unreleased versions.
|
|
249
254
|
|
|
250
|
-
-
|
|
255
|
+
- Drop All `DEF` Macros, I'm currently seeking help on replacements for macros where all the variables are known about at compile-time
|
|
256
|
+
|
|
257
|
+
- Adding in the necessary hooks for pyinstaller to compile this fast library to executable code even though hooks have been known to inflate the size of the `.exe` files. This is because calling hidden-imports for all the `__init__.py` modules might annoy some developers. (Luckily I'm aware of this issue because I've been doing this myself...)
|
|
251
258
|
|
|
252
|
-
-
|
|
259
|
+
- write a workflow for compiling libuv on different versions of windows when distributing out pypi wheels.
|
|
253
260
|
|
|
254
|
-
-
|
|
261
|
+
- write a workflow for nightly builds if necessary for verification of pull requests.
|
|
255
262
|
|
|
256
|
-
-
|
|
263
|
+
- Sphinx Styled Documentation (Maybe I'm thinking about it...)
|
|
257
264
|
|
|
265
|
+
- Update benchmarks (They are old) can't believe I maintained this project for over a year now...
|
|
258
266
|
|
|
259
267
|
## Videos
|
|
260
268
|
- By me: https://www.youtube.com/watch?v=tz9RYJ6aBZ8 (I might make a tutorial on how to use and install winloop it for those who have reading problems)
|
|
261
|
-
- My Presentation and Virtual Confrence: https://www.youtube.com/watch?v=Cbb6trkKWXY
|
|
269
|
+
- My Presentation and Virtual Confrence: https://www.youtube.com/watch?v=Cbb6trkKWXY
|
|
270
|
+
|
|
271
|
+
## Contributing
|
|
272
|
+
I put my heart and soul into this library ever since it began and any help is apperciated and means a lot to me.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Copied with minimal modifications from curio
|
|
2
|
+
# https://github.com/dabeaz/curio
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import concurrent.futures
|
|
7
|
+
import socket
|
|
8
|
+
import ssl
|
|
9
|
+
import time
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if __name__ == '__main__':
|
|
13
|
+
parser = argparse.ArgumentParser()
|
|
14
|
+
parser.add_argument('--msize', default=1000, type=int,
|
|
15
|
+
help='message size in bytes')
|
|
16
|
+
parser.add_argument('--mpr', default=1, type=int,
|
|
17
|
+
help='messages per request')
|
|
18
|
+
parser.add_argument('--num', default=200000, type=int,
|
|
19
|
+
help='number of messages')
|
|
20
|
+
parser.add_argument('--times', default=1, type=int,
|
|
21
|
+
help='number of times to run the test')
|
|
22
|
+
parser.add_argument('--workers', default=3, type=int,
|
|
23
|
+
help='number of workers')
|
|
24
|
+
parser.add_argument('--addr', default='127.0.0.1:25000', type=str,
|
|
25
|
+
help='address:port of echoserver')
|
|
26
|
+
parser.add_argument('--ssl', default=False, action='store_true')
|
|
27
|
+
args = parser.parse_args()
|
|
28
|
+
|
|
29
|
+
client_context = None
|
|
30
|
+
if args.ssl:
|
|
31
|
+
print('with SSL')
|
|
32
|
+
if hasattr(ssl, 'PROTOCOL_TLS'):
|
|
33
|
+
client_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
|
34
|
+
else:
|
|
35
|
+
client_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
|
|
36
|
+
if hasattr(client_context, 'check_hostname'):
|
|
37
|
+
client_context.check_hostname = False
|
|
38
|
+
client_context.verify_mode = ssl.CERT_NONE
|
|
39
|
+
|
|
40
|
+
unix = False
|
|
41
|
+
if args.addr.startswith('file:'):
|
|
42
|
+
unix = True
|
|
43
|
+
addr = args.addr[5:]
|
|
44
|
+
else:
|
|
45
|
+
addr = args.addr.split(':')
|
|
46
|
+
addr[1] = int(addr[1])
|
|
47
|
+
addr = tuple(addr)
|
|
48
|
+
print('will connect to: {}'.format(addr))
|
|
49
|
+
|
|
50
|
+
MSGSIZE = args.msize
|
|
51
|
+
REQSIZE = MSGSIZE * args.mpr
|
|
52
|
+
|
|
53
|
+
msg = b'x' * (MSGSIZE - 1) + b'\n'
|
|
54
|
+
if args.mpr:
|
|
55
|
+
msg *= args.mpr
|
|
56
|
+
|
|
57
|
+
def run_test(n):
|
|
58
|
+
print('Sending', NMESSAGES, 'messages')
|
|
59
|
+
if args.mpr:
|
|
60
|
+
n //= args.mpr
|
|
61
|
+
|
|
62
|
+
if unix:
|
|
63
|
+
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
64
|
+
else:
|
|
65
|
+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
69
|
+
except (OSError, NameError):
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
if client_context:
|
|
73
|
+
sock = client_context.wrap_socket(sock)
|
|
74
|
+
|
|
75
|
+
sock.connect(addr)
|
|
76
|
+
|
|
77
|
+
while n > 0:
|
|
78
|
+
sock.sendall(msg)
|
|
79
|
+
nrecv = 0
|
|
80
|
+
while nrecv < REQSIZE:
|
|
81
|
+
resp = sock.recv(REQSIZE)
|
|
82
|
+
if not resp:
|
|
83
|
+
raise SystemExit()
|
|
84
|
+
nrecv += len(resp)
|
|
85
|
+
n -= 1
|
|
86
|
+
|
|
87
|
+
TIMES = args.times
|
|
88
|
+
N = args.workers
|
|
89
|
+
NMESSAGES = args.num
|
|
90
|
+
start = time.time()
|
|
91
|
+
for _ in range(TIMES):
|
|
92
|
+
# Winloop comment: switch from ProcessPoolExecutor to
|
|
93
|
+
# ThreadPoolExecutor to avoid issues with __mp_main__ on Windows.
|
|
94
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=N) as e:
|
|
95
|
+
for _ in range(N):
|
|
96
|
+
e.submit(run_test, NMESSAGES)
|
|
97
|
+
end = time.time()
|
|
98
|
+
duration = end - start
|
|
99
|
+
print(NMESSAGES * N * TIMES, 'in', duration)
|
|
100
|
+
print(NMESSAGES * N * TIMES / duration, 'requests/sec')
|