CLI tool for the Shopcloud EventBus
Project description
Shopcloud-EventBus
Async Processing, write to Log an Event and send it to a Queue
graph TD;
AppEngine-->Log;
Log-->EventBus;
EventBus-->AppEngine;
Usage
$ pip install shopcloud-eventbus
$ eventbus init
$ eventbus deploy
Vanilla:
from shopcloud_eventbus import Event
event = Event(
name="de.talk-point.platform/module/model/sync",
model=self,
)
event.add_task(
queue="default",
url=f"module/api/model/{self.id}/action/",
json={}
)
event.fire()
Django
use for example the shopcloud-django-toolbox library
from shopcloud_django_toolbox import Event
event = Event(
name="de.talk-point.platform/module/model/sync",
model=self,
)
event.add_task(
queue="default",
url=f"module/api/model/{self.id}/action/",
json={}
)
event.fire()
Install
Services
$ gcloud services enable cloudtasks.googleapis.com --project="test-eventbus-project"
$ gcloud pubsub topics create events --project='test-eventbus-project'
$ gcloud tasks queues create default --project='test-eventbus-project' --location='europe-west3'
Log Sink
Create a log sink with the following filter resource.type="gae_app" "event-fire"
$ eventbus --help
$ eventbus deploy
Development
$ python3 setup.py install
$ python3 -m shopcloud_eventbus -d init --project="test-eventbus-project" --region="europe-west3" --app-endpoint="https://test-eventbus-project.ey.r.appspot.com" --secrethub-endpoint-user="talk-point/app-eventbus-test/production/evenbus-user" --secrethub-endpoint-pwd="talk-point/app-eventbus-test/production/evenbus-pwd"
$ python3 -m shopcloud_eventbus -d deploy
dann kann das Script getestet werden per
$ cd .eventbus
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ functions-framework --target main_http --debug
oder deployen und eine Test-Message durchsenden
Deploy
$ rm -rf build dist
$ pip3 install wheel twine
$ python3 setup.py sdist bdist_wheel
$ twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for shopcloud_eventbus-1.1.1-py3.11.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7319791f6848cd2f784685c600e97ca1b42089f163cc3e4f3c2b51e7cde1f42 |
|
MD5 | c947dfe3a34ac190bf4ce3649f601fe9 |
|
BLAKE2b-256 | 7a94ee42a5c93ef8d5c9db1d8d11df9b992207e677a25dd2b5883fec207b9b91 |
Close
Hashes for shopcloud_eventbus-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eda61e8398b46fe03a98b941d6025a012f788923f7abd2797cb4c9e79227f8e1 |
|
MD5 | a82e49c7091c86411b5eea71e135c5fd |
|
BLAKE2b-256 | 1afa98728ebd9e5b7c74e34d8488e661557f4d7cb2e2d299ef5f805527181efa |