Skip to main content

JFSmallThread

简易版并发请求库:支持http协议高并发发送,比 aiohttp和requests 更快。 设置tps,控制函数发送速度, 提高执行效率

N|Solid

Build Status

Installation

pip install JFSmallThread

设置tps
tps_pool = TpsThreadPoolExecutor(tps=20)
    for i in range(100):
        # tps_pool.submit(f1, i)
        tps_pool.submit(test_by_nb_http_client)
    tps_pool.shutdown()
    
不设置
http_pool = ObjectPool(object_type=HttpOperator, object_pool_size=50,
                       object_init_kwargs=dict(host='xxxx', port=xxx),
                       max_idle_seconds=30)

thread_pool = BoundedThreadPoolExecutor(50)


def test_http_client():
    """
    type: typing.Union[HttpOperator,HTTPConnection]
    http对象池的请求速度暴击requests的session和直接requests.get
    """
    with http_pool.get() as conn:
        r1 = conn.speed_request()
        print(r1.text)

License

MIT

Free Software, Hell Yeah!

Metadata

Release files for JFSmallThread 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for JFSmallThread 1.0.0
File Size Uploaded Provenance Actions
JFSmallThread-1.0.0.tar.gz 7.8 kB Without provenance Details for JFSmallThread-1.0.0.tar.gz

Release files / JFSmallThread-1.0.0.tar.gz

Download URL JFSmallThread-1.0.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dc70caa6ad6c6afb9285821dc3013827ba2a187fead200a2da75d8cd03b27781
BLAKE2b-256 checksum
How to use checksums
a35f568493b77e19828518092f332fd2417c02d26f629bd7f506705f22c01f1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Security for JFSmallThread 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page