Releases: Ananto30/zero
Releases · Ananto30/zero
v1.0.1
v1.0.0
Added TCP client/server protocol for faster communication
Breaking changes
- Protocol Parameter Changed from String to Type
Old:protocol: str = "zeromq"(string name)
New:protocol: Type[ZeroClientProtocol] = ZMQClient(class type)
Migration:
# Old
ZeroClient("localhost", 5559, protocol="zeromq")
# New
from zero.protocols.zeromq.client import ZMQClient
ZeroClient("localhost", 5559, protocol=ZMQClient)
- Encoder Parameter Changed from Instance to Type
Old:encoder: Optional[Encoder] = None(instance or None)
New:encoder: Type[Encoder] = GenericEncoder(class type)
Migration:
# Old
ZeroClient("localhost", 5559, encoder=MyEncoder())
# New
from zero.encoder import MyEncoder
ZeroClient("localhost", 5559, encoder=MyEncoder)
get_rpc_contractsignature is changed. It's not possible to generate code from new version to old version and vice versa.
What's Changed
Full Changelog: v0.9.0-beta...v1.0.0
v0.9.0-beta
Now supports Pydantic! 🙌
Thanks to @martincpt !
Breaking change
- Python 3.8 is not supported anymore.
What's Changed
- Add GenericEncoder and Pydantic support by @martincpt in #63
- Fix pydantic lint issues by @Ananto30 in #64
- Add benchmark history for better visibility by @Ananto30 in #65
- Improve async client to use recv_task for response tracking by @Ananto30 in #66
New Contributors
- @martincpt made their first contribution in #63
Full Changelog: v0.8.0-beta...v0.9.0-beta
v0.8.0-beta
What's Changed
- Codegen now produce models by @Ananto30 in #57
- Update github actions versions by @Ananto30 in #58
- Fix codecov action to take token by @Ananto30 in #59
- Add python 3.11 and 3.12 in github action by @Ananto30 in #61
- Support thread workers by @Ananto30 in #60
Full Changelog: v0.7.0-beta...v0.8.0-beta
v0.7.0-beta
Improve client using asyncio event
Full Changelog: v0.6.0-beta...v0.7.0-beta
v0.6.0-beta
Now on server, the rpc functions args are converted to actual object as their type hints!
v0.5.2-beta
What's Changed
Full Changelog: v0.5.1-beta...v0.5.2-beta
v0.5.1-beta
What's Changed
Full Changelog: v0.5.0-beta...v0.5.1-beat
v0.5.0-beta
What's Changed
- Update rpc return type to return bool instead of None on README by @zakybilfagih in #45
- Fix http request handle issue by @Ananto30 in #42
- Make connection pool for each threads in client by @Ananto30 in #46
New Contributors
- @zakybilfagih made their first contribution in #45
Full Changelog: v0.4.0-beta...v0.5.0-beta
v0.4.0-beta
Msgspec as default serializer! 🙌
Default serializer
Msgspec is the default serializer. So msgspec.Struct (for high performance) or dataclass or any supported types can be used easily to pass complex arguments, i.e.
from dataclasses import dataclass
from msgspec import Struct
from zero import ZeroServer
app = ZeroServer()
class Person(Struct):
name: str
age: int
dob: datetime
@dataclass
class Order:
id: int
amount: float
created_at: datetime
@app.register_rpc
def save_person(person: Person) -> None:
# save person to db
...
@app.register_rpc
def save_order(order: Order) -> None:
# save order to db
...Return type
The return type of the RPC function can be any of the supported types. If return_type is set in the client call method, then the return type will be converted to that type.
@dataclass
class Order:
id: int
amount: float
created_at: datetime
def get_order(id: str) -> Order:
return zero_client.call("get_order", id, return_type=Order)What's Changed
Full Changelog: v0.3.60-beta...v0.4.0-beta