Skip to main content

No project description provided

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.6+

  • 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:

pip install pop-loop\[trio\]

uvloop:

pip install pop-loop\[uvloop\]
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:

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:

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:

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


hub = pop.hub.Hub()
hub.loop.qt.APP = pyqt5.QApplication([])
hub.loop.init.create("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.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

pop_loop-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pop-loop-1.0.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pop-loop-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0d95fce14a7d209a2ea6fd66f1e1b1f24164bafc938407e7cc6433efdb03f35f
MD5 e6f6a3d9b0b3add02d56401e73cff774
BLAKE2b-256 69f2c040d497175d923d84108c0d7c34a7de15ed990cd59168a588bd8c516e7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pop_loop-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pop_loop-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4edf7ef8e4881f4fd8acd614de94dc1eef7ddae99fa0329cefe86d11508010
MD5 a083eb40f2d0bc4958d453e77dac412d
BLAKE2b-256 bd57d4f52df062770fa6a57189bea9b59bcdc4cefdfbce8a8457a21cd6e2e33a

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