All Projects → ddmee → polling2

ddmee / polling2

Licence: MIT license
Powerful polling utility in Python

Programming Languages

python
139335 projects - #7 most used programming language
powershell
5483 projects

Projects that are alternatives of or similar to polling2

Bitpoll
A web application for scheduling meetings and general polling.
Stars: ✭ 182 (+271.43%)
Mutual labels:  polling
qlicker
Open Source Clicker
Stars: ✭ 23 (-53.06%)
Mutual labels:  polling
Telegrambots
Java library to create bots using Telegram Bots API
Stars: ✭ 2,728 (+5467.35%)
Mutual labels:  polling
Netty Socketio
Socket.IO server implemented on Java. Realtime java framework
Stars: ✭ 5,565 (+11257.14%)
Mutual labels:  polling
Primus
⚡ Primus, the creator god of the transformers & an abstraction layer for real-time to prevent module lock-in.
Stars: ✭ 4,302 (+8679.59%)
Mutual labels:  polling
longpoll-doc
Документация для (почти) последней версии User LongPoll API
Stars: ✭ 56 (+14.29%)
Mutual labels:  polling
luasocketio
socket.io client implemented in pure Lua
Stars: ✭ 20 (-59.18%)
Mutual labels:  polling
comet
A http long polling comet implementation for nodejs and browser
Stars: ✭ 20 (-59.18%)
Mutual labels:  polling
ember-poller
A poller service based on ember-concurrency
Stars: ✭ 15 (-69.39%)
Mutual labels:  polling
mcp3008.js
A node.js module for querying an mcp3008 analog/digital converter.
Stars: ✭ 24 (-51.02%)
Mutual labels:  polling
use-axios-hooks
axios hooks for common network calls scenarios
Stars: ✭ 27 (-44.9%)
Mutual labels:  polling
EncoderTool
The EncoderTool is a library to manage and read out rotary encoders connected either directly or via multiplexers to ARM based boards. Encoder push buttons are supported. Callback functions can be attached to encoder changes and button presses to allow for event driven applications
Stars: ✭ 29 (-40.82%)
Mutual labels:  polling
spring-file-poller
A simple spring boot application that demonstrates file polling using the Spring Integration DSL
Stars: ✭ 25 (-48.98%)
Mutual labels:  polling
toiler
Toiler is a AWS SQS long-polling thread-based message processor.
Stars: ✭ 15 (-69.39%)
Mutual labels:  polling
appium-device-farm
This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
Stars: ✭ 124 (+153.06%)
Mutual labels:  polling

Build Status PyPI PyPI Documentation Status Quality Gate Status Bugs Vulnerabilities Security Rating Code Smells

polling2

Never write another polling function again!

Documentation available at Read the Docs

You can install the package from Pypi

Polling2 is a powerful python utility used to wait for a function to return a certain expected condition.

Some possible uses cases include:

  • Wait for API response to return with code 200
  • Wait for a file to exist (or not exist)
  • Wait for a thread lock on a resource to expire

Polling2 is handy for getting rid of all that duplicated polling-code. Often, applications require retrying until the correct response is returned. Why re-implement the ability to poll again and again? Use Polling2!

Polling2 is a fork of the original polling. It was forked when the original maintainer failed to respond to issues or PRs.

Polling2 is under active development. Would you like to see a particular feature? Ask and thou shall recieve.

Installation

pip install polling2

Development installation

# install lib, but use system links from the repo into sitepackages.
python setup.py develop
# install test dependenices.
python setup.py test
# run the tests
pytest tests

Note, tox is also available, as well as pre-commit.

# install tox and run it
pip install tox
tox

Pre-commit performs auto-formatting and things of that nature before each commit.

pip install pre-commit
pre-commit install

Now pre-commit will run automatically on git commit.

Example:

# This call will wait until the file exists, checking every 0.1 seconds and stopping after 3 seconds have elapsed
file_handle = polling2.poll(
    lambda: open('/tmp/myfile.txt'),
    ignore_exceptions=(IOError,),
    timeout=3,
    step=0.1)

# Polling will return the value of your polling function, so you can now interact with it
file_handle.close()

There are more examples in the documentation.

API and user guide at Read the Docs

Read the Docs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].