Skip to main content

Multi-transport RPC with asyncio & Django support.

Project description

https://raw.githubusercontent.com/and3rson/radical/master/images/logo.png

Decription

About

Radical is a RPC library that allows you to have cross-service communication out of the box.

It can serve as a replacement for Celery.

Radical has out-of-the-box integration with Django and also supports asyncio, but can be used without it.

Radical is easily extensible with custom transports and serializers.

Available transports:

  • Redis

  • Postgres

Default and recommended transport is Redis.

Available serializers:

  • JSON

  • Pickle

Default and recommended serializer is Pickle.

Glossary

Term

Meaning

Service

A fully autonomous application written with Django, Sanic or vanilla Python.

Transport

Module that provides interface to actual network communication: for example, a Redis transport.

Serializer

Module that provides interface to data serialization and deserialization.

Quick start

Installing

pip install radical-rpc

Using with Django

  1. Add Radical to INSTALLED_APPS:

    INSTALLED_APPS = [
        # ...
        'radical',
        # ...
    ]
  2. Configure Radical:

    RADICAL_CONFIG = {
        'TRANSPORT_URL': 'redis://redis:6379/0?request_timeout=10',
        'QUEUE_NAME': 'myapp',
        'MODULES': [
            'radical.demo'
        ]
    }
  3. Call it anywhere:

    from radical.contrib.django import call_wait, call
    from django.http import JsonResponse
    
    def some_view(request):
        # Call remote method and wait for it to return result.
        result = call_wait('myapp', 'radical.demo.add', 1300, 37)
        return JsonResponse(dict(result=result))  # Returns {'result': 1337}
    
    def some_view(request):
        # Call remote method and do not wait for it to finish.
        call('myapp', 'radical.demo.add', 1300, 37)
        return JsonResponse(dict(result='Job was scheduled.'))
  4. Start Radical worker:

    ./manage.py radical

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

radical-rpc-0.1.7.tar.gz (11.8 kB view details)

Uploaded Source

File details

Details for the file radical-rpc-0.1.7.tar.gz.

File metadata

  • Download URL: radical-rpc-0.1.7.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for radical-rpc-0.1.7.tar.gz
Algorithm Hash digest
SHA256 b77e2c3c98d487f8a6cebb03fbb360f94aada3b73457a48951416c628dc67364
MD5 a6f395cefeeaae0ef00c202f986133d1
BLAKE2b-256 2c890412865593dd0a6e8b7125c25720800077ff3d2a7519b80d9677c35b9a79

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