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 Distribution
File details
Details for the file shopcloud_eventbus-1.5.0.tar.gz
.
File metadata
- Download URL: shopcloud_eventbus-1.5.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe3222178728269c585436153ce7f0bcff66b8660f61271342ea036acc0a4e9 |
|
MD5 | 8088b80847023d3cf5ab43e0efd95350 |
|
BLAKE2b-256 | 6dca3d2f6b47c299f092b6d5e3f08c2bc5f03a5d898649f92be2479e227f630a |
File details
Details for the file shopcloud_eventbus-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: shopcloud_eventbus-1.5.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eba6e7dc88b5434d414abae95b70f9d14880d04ffa1ed4daa5defa64c5352229 |
|
MD5 | 7fc0a24f4f009f8aa9ad914e241a2251 |
|
BLAKE2b-256 | 7e8b4f24c94cfdaa9f6fda0100fdd63c28d052dca197a6d3116b2ca05c34bf2a |