New features π
- Added ingress client to send requests from your python applications to restate services:
async with restate.create_client("http://localhost:8080") as client:
await client.object_call(increment, key="a", arg=5)
await client.object_send(increment, key="a", arg=5)
current_count = await client.object_call(count, key="a", arg=None)- Added new test harness constructor to be used in combination with
@pytest.fixture:
# Your fixture
@pytest.fixture(scope="session")
async def restate_test_harness():
app = restate.app([greeter])
async with restate.create_test_harness(app) as harness:
yield harness
# A test example, using the client
async def test_greeter(restate_test_harness: HarnessEnvironment):
greeting = await restate_test_harness.client.service_call(greet, arg="Pippo")
assert greeting == "Hello Pippo!"- Various type hints improvements, such as #112
What's Changed
- Revert usage of asyncio cancellation mechanism by @slinkydeveloper in #142
- Update
crazy-max/ghaction-setup-dockerto v4 by @muhamadazmy in #144 - Use modern lints, tools and type checkers by @igalshilman in #143
- Add typed client by @igalshilman in #145
- Add test for harness and typed client. Fix name of TestHarnessEnvironment so it doesn't get mixed up in pytest. Fix imports in init by @slinkydeveloper in #147
Full Changelog: v0.11.0...v0.12.0