#
#  Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH
#
#  This file is part of the Restate SDK for Python,
#  which is released under the MIT license.
#
#  You can find a copy of the license in file LICENSE in the root
#  directory of this repository or package, or at
#  https://github.com/restatedev/sdk-typescript/blob/main/LICENSE
#
import restate

from virtual_object import increment, count

#
# uv run examples/client.py
#


async def main():
    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)

        print(f"Current count for 'a': {current_count}")


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())
