Skip to content

Releases: Ananto30/zero

v1.0.1

22 Dec 13:54

Choose a tag to compare

Updates

  • Fixed return_type not converting to proper objects
  • Add return_type in generated code
  • Increase default client timeout to 5 seconds

Full Changelog: v1.0.0...v1.0.1

v1.0.0

20 Dec 21:36

Choose a tag to compare

Added TCP client/server protocol for faster communication

Breaking changes

  1. 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)
  1. 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)
  1. get_rpc_contract signature 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

26 Jul 19:01

Choose a tag to compare

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

Full Changelog: v0.8.0-beta...v0.9.0-beta

v0.8.0-beta

12 Jul 21:23

Choose a tag to compare

What's Changed

Full Changelog: v0.7.0-beta...v0.8.0-beta

v0.7.0-beta

28 Jun 22:05

Choose a tag to compare

v0.6.0-beta

28 Jun 21:56

Choose a tag to compare

Now on server, the rpc functions args are converted to actual object as their type hints!

Add schema validation

v0.5.2-beta

28 Jun 21:52

Choose a tag to compare

What's Changed

Full Changelog: v0.5.1-beta...v0.5.2-beta

v0.5.1-beta

28 Jun 21:37

Choose a tag to compare

What's Changed

  • Run async functions in a separate thread by @Ananto30 in #52

Full Changelog: v0.5.0-beta...v0.5.1-beat

v0.5.0-beta

25 Oct 18:33

Choose a tag to compare

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

Full Changelog: v0.4.0-beta...v0.5.0-beta

v0.4.0-beta

10 Jun 07:18

Choose a tag to compare

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