Skip to main content

Plugins that allow alternate io loops to be used to run asynchronous code in pop projects

Project description

Made with pop, a Python implementation of Plugin Oriented Programming Made with Python

pop-loop Contains plugins that allow alternate io loops to be used to run asynchronous code in pop projects.

About

Pop used the asyncio loop by default in a built-in mod at ‘hub.pop.loop’. It became necessary to split the mod into it’s own project for more loop capabilities. For testing, loop management was difficult, but paired with pytest-pop, pop-loop makes async testing easy.

What is POP?

This project is built with pop, a Python-based implementation of Plugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.

For more information:

Getting Started

Prerequisites

  • Python 3.7+

  • git (if installing from source, or contributing to the project)

Installation

If wanting to use pop-loop, you can do so by either installing from PyPI or from source.

Install from PyPI

If package is available via PyPI, include the directions.

pip install pop-loop

Install Extras

pop-loop can be installed with extras to enable the different loop plugins in this project.

trio: .. code-block:: bash

pip install pop-loop[trio]

uvloop: .. code-block:: bash

pip install pop-loop[uvloop]

qt: .. code-block:: bash

pip install pop-loop[qt]

Install from source

# clone repo
git clone git@gitlab.com/saltstack/pop/pop-loop.git
cd pop-loop

# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

Describe some basic example use case for this plugin.

Examples

uvloop example: .. code-block:: python

import asyncio import pop.hub

hub = pop.hub.Hub()

hub.pop.loop.create(loop_plugin=”uv”) task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)

trio example: .. code-block:: python

import asyncio import pop.hub

hub = pop.hub.Hub()

hub.pop.loop.create(loop_plugin=”trio”) task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)

QT example: .. code-block:: python

import asyncio import pop.hub import PyQt5.QtWidgets as pyqt5

hub = pop.hub.Hub() hub.loop.qt.APP = pyqt5.QApplication([]) hub.pop.loop.create(loop_plugin=”qt”)

task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pop-loop-1.0.6.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

pop_loop-1.0.6-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file pop-loop-1.0.6.tar.gz.

File metadata

  • Download URL: pop-loop-1.0.6.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.15

File hashes

Hashes for pop-loop-1.0.6.tar.gz
Algorithm Hash digest
SHA256 94c61e02171102864b159255c6a8c389b57cde0ec876ac6fc9a000807e7bbae1
MD5 93732f5af079257a4778e0eb42a11fbb
BLAKE2b-256 111519a076b198fe28d18cb8100727e0af8504ed9a5bcf7e2099e33cb0d985a3

See more details on using hashes here.

File details

Details for the file pop_loop-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: pop_loop-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.15

File hashes

Hashes for pop_loop-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9630bda7d780b9d991d95bc1d764418deea002282736ac5d729aaf3161c1a0
MD5 ed7b3d63996f8c11da229c682ccd431b
BLAKE2b-256 6d7e4a4b235506486dfef094c71f94b0825a75359777839dd539432e86d26501

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page