This package provides an example implementation of a Pacifica Dispatcher.
This package is divided into the following source files:
pacifica/
__init__.py
= The namespace declaration for the parentpacifica
package.dispatcher_example/
__init__.py
= The initializer for this package.__main__.py
= The entrypoint for this package.event_handlers.py
= The event handlers for this package.router.py
= The router for this package.
Please read the source files for more information about their content.
This package is installed using the following commands:
python3 -m pip install -e .
This package is tested using the following commands:
cd tests
python3 -m unittest example_test.py
This package is started in three stages, where each stage occurs in a separate terminal emulator session:
- The message queue is started;
- The worker for the task queue is started; and
- The web server is started.
The message queue is started using the following commands:
docker-compose up rabbit
The worker for the task queue is started using the following commands:
env DATABASE_URL="sqliteext:///db.sqlite3" celery -A "pacifica.dispatcher_example.__main__:celery_app" worker -l info
The web server is started using the following commands:
env DATABASE_URL="sqliteext:///db.sqlite3" python3 -m "pacifica.dispatcher_example.__main__"
Note: The DATABASE_URL
environment variable specifies the connection URL
for the database. In this guide, the database is managed using
SQLite, where the database itself is stored in the
db.sqlite3
file in the root directory of this package.