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.16.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7715204aac74cd7c36639647c72cee4a0b4a9592a7d94a2bee054b602bc488 |
|
MD5 | 05bd80dbb8d62a74905411e079df3cdb |
|
BLAKE2b-256 | 4fe9a6c211b896d1c7d3b08f3f5dd42b5e57a6cc654684f5cf217726ee3a1003 |
Close
Hashes for hopeit.apps_client-0.16.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af19f8d2e401408e85108325f165cf6f6393d735bfa6824ba0e692048807e51b |
|
MD5 | 203bcd28ed5431e119c3bc55a7ab3622 |
|
BLAKE2b-256 | 3dae7c64778684c1b9f9e7f35aa7226d12f4328b429bbcc19051be74ba6b1dd2 |