Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

quantmind/pulsar-cloud

Repository files navigation

Badges:license pyversions status pypiversion
Master CI:master-build coverage-master
Downloads:http://pypi.python.org/pypi/pulsar-cloud
Source:https://github.com/quantmind/pulsar-cloud
Mailing list:google user group
Design by:Quantmind and Luca Sbardella
Platforms:Linux, OSX, Windows. Python 3.5 and above
Keywords:amazon, aws, botocore, pusher, websocket, async, pulsar, greenlet

CHANGELOG

This library provides two asynchronous implementations of botocore.

Some part of the module are taken from aiobotocore - apache LICENSE.

The first implementation uses asyncio from the python standard libray only and requires an asyncio compatible HTTP client such as the pulsar one (used by default):

from cloud.aws import AsyncioBotocore

s3 = AsyncioBotocore('s3', 'us-east-1')
s3 = await s3.put_object(...)

The second implementation, build on top of asyncio botocore, uses pulsar and greenlet to obtain an implicit asynchronous behaviour.

Usage:

from cloud.aws import GreenBotocore
from pulsar.apps.greenio import GreenPool

def execute():
    s3 = GreenBotocore('s3', 'us-east-1')
    ec2.put_object(...)

pool = GreenPool()
await pool.submit(execute)

Usage:

s3upload <path> -b bucket/my/location

A client and server pusher implementation using pulsar asynchronous framework. Create a pusher instance

from cloud import Pusher

pusher = Pusher(app_id, key, secret)

Subscribe to a channel as a client

channel = await pusher.subscribe('test_channel')
channel.bind('event', mycallback)