Skip to main content

Generic backend pool

Project description

https://travis-ci.org/luizalabs/ramos.svg?branch=master https://codecov.io/gh/luizalabs/ramos/branch/master/graph/badge.svg

Generic backend pool

Setup

pip install ramos

Development setup

make install

Usage

import ramos

ramos.configure(pools={
    'backend_type': [
        'path.to.backend_a',
        'path.to.backend_b',
    ]
})

Integrations

Ramos can uses Django or Simple Settings to get backends configurations if set settings.POOL_OF_RAMOS:

POOL_OF_RAMOS = {
    'backend_type': [
        'path.to.backend_a',
        'path.to.backend_b',
    ]
}

Backend Implementations

from ramos.mixins import ThreadSafeCreateMixin


class BackendA(ThreadSafeCreateMixin):
    id = 'backend_a'
    def say(self):
        return 'A'


class BackendB(ThreadSafeCreateMixin):
    id = 'backend_b'
    def say(self):
        return 'B'

Backend Pool

from ramos.pool import BackendPool


class BackendTypePool(BackendPool)
    backend_type = 'backend_type'


backends = BackendTypePool.all()

for backend in backends:
    print(backend.say())


# backend_a = BackendTypePool.get('backend_a')
# backend_b = BackendTypePool.get('backend_b')

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

ramos-1.4.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

ramos-1.4.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ramos-1.4.0.tar.gz.

File metadata

  • Download URL: ramos-1.4.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.15

File hashes

Hashes for ramos-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d8c8a6d990dc5278ee1553b88bb1f8663d53d8256361ee9b5e74beecc03e3ba3
MD5 876f5664714e1695081e2f16a428151d
BLAKE2b-256 6f91b19d56327c8e73780194758cc833384991d312040fb324ed248182276063

See more details on using hashes here.

File details

Details for the file ramos-1.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ramos-1.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.15

File hashes

Hashes for ramos-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ed1b12996d412cfe607e9b97b57dded8870d1690059d5c559905b24c55f267e
MD5 f630a0ce89a01220d5fb610bc320000f
BLAKE2b-256 c7c8bc9ce84d59e507f33bdac8409138750ce9cfeab8e48a041360f331b5c29c

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