Hopeit Apps Client Plugin
Project description
hopeit.engine apps-client plugin
This library is part of hopeit.engine:
Install using hopeit.engine extras [apps-client]:
pip install hopeit.engine[apps-client]
Config app_connection section in your app to use this client implementation:
Configre a connection in app_connections
section and specify which events to invoke
inside event.connections
section:
...
"app_connections": {
"target-app-conn": {
"name": "target-app",
"version": "1.0",
"client": "hopeit.apps_client.AppsClient"
}
},
...
"events": {
"my-event": {
...
"connections": [
{
"app_connection": "target-app-conn",
"event": "target-event",
"type": "GET"
}
],
...
}
}
To configure apps-client
add a settings section like this to app config file:
...
"settings": {
"simple_example_conn": {
"connection_str": "http://host1,http://host2"
}
}
The only required setting is connection_str
but many other values can be configured:
...
"settings": {
"simple_example_conn": {
"connection_str": "${HOPEIT_SIMPLE_EXAMPLE_HOSTS}",
"circuit_breaker_open_failures": 10,
"circuit_breaker_failure_reset_seconds": 90.0,
"circuit_breaker_open_seconds": 60.0,
"retries": 2,
"retry_backoff_ms": 10,
"ssl": true,
"max_connections": 100,
"max_connections_per_host": 0,
"dns_cache_ttl": 10,
"routes_override": {
"__list-somethings": "simple-example/${HOPEIT_APPS_ROUTE_VERSION}/list-somethings"
}
}
}
Usage
Invoking target-app target-event from your application code:
from hopeit.app.client import app_call
...
def my_event(payload: ..., context: EventContext) -> ...:
response = await app_call(
"target-app-conn", event="target-event",
datatype=ResposeDataType, payload=..., context=context
)
...
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
Close
Hashes for hopeit.apps-client-0.10.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ca0d195d8e5e11616d0d9a2fdeeaad1b4dcdec1ca2a3c3f2d301669d1cc8108 |
|
MD5 | e5d6a04c5a6a56da82d84bce0a695e29 |
|
BLAKE2b-256 | ec1fc3a1555c9d6a1cf1c723d98b405f55748e56724bde7e6b65f51c9b2b0698 |
Close
Hashes for hopeit.apps_client-0.10.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b84e7c150eaab5c2d9e603bfc311cd7c6a0fd2ca45548aabe6c7eb2ae9b036 |
|
MD5 | dea6106e4bff6cdbbf84437554754761 |
|
BLAKE2b-256 | 95e9f0b59f7e50dbcb3ea77ec5eea57bb7728ff4aa8b5e652a4e98cd5b2a7c61 |