Skip to main content

jk_trioping

Introduction

This python module provides an asynchroneous version of ping. It is based on the trio framework.

Information about this module can be found here:

Why this module?

It is not too difficult to perform a ping to multiple hosts in parallel. Suprisingly modules, examples or even binaries to do exactly that are hard to find. This modules now offers a simple solution to that problem.

How to use this module

Import this module

Please include this module into your application using the following code:

import trio
import jk_trioping

Perform single ping

async def main(hostAddress):
	ret = await jk_trioping.ping(
		host = hostAddress,
		timeout = 2,
		repeats = 1
	)
	print(ret)

trio.run(main, "127.0.0.1")

This will perform a single ping to a single host. The result will look something like this:

0.063

Perform multiple pings

async def main(hostAddresses):
	ret = await jk_trioping.multiPing(
		hosts = hostAddresses,
		timeout = 2,
		repeats = 1
	)
	print(ret)

trio.run(main, [ "127.0.0.1", "localhost" ])

This will perform a ping to two hosts (addressing one by IP address, one by name) and print something like this:

{'localhost': 0.071, '127.0.0.1': 0.073}

Contact Information

This is Open Source code. That not only gives you the possibility of freely using this code it also allows you to contribute. Feel free to contact the author(s) of this software listed below, either for comments, collaboration requests, suggestions for improvement or reporting bugs:

License

This software is provided under the following license:

  • Apache Software License 2.0

Metadata

Release files for jk-trioping 0.2020.4.1

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

Source distribution (sdist)

Source distribution for jk-trioping 0.2020.4.1
File Size Uploaded
jk_trioping-0.2020.4.1.tar.gz 8.1 kB Details

Release files / jk_trioping-0.2020.4.1.tar.gz

Download URL jk_trioping-0.2020.4.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e931dd7c825c6a5c8ef852259db3fdff48a22151bffbb68c06126cd6fcfc936d
BLAKE2b-256 checksum
How to use checksums
1acda88a9f75098b03f4fd494127b7468b693683b9e783bc4bec154a19831a7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

Release history Release notifications | RSS feed

This release

0.2020.4.1 This release

1 release file

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