Skip to content

Release v2.3.0

Compare
Choose a tag to compare
@wallyqs wallyqs released this 03 Jun 04:14
· 103 commits to main since this release
533bd8f
pip install nats-py

Added

  • Added object store feature based on initial contribution by @domderen (#452 || #446)

Upload example:

import nats
import asyncio

async def main():
    nc = await nats.connect("locahost", name="object.py")
    js = nc.jetstream()
    obs = await js.create_object_store("nats-py-object-store")

    object_name = 'my-file.mp4'
    with open(object_name) as f:
        await obs.put(object_name, f)

    await nc.close()

if __name__ == '__main__':
    asyncio.run(main())

Download example:

import nats
import asyncio

async def main():
    nc = await nats.connect("localhost", name="object.py")
    js = nc.jetstream()
    obs = await js.object_store("nats-py-object-store")

    files = await obs.list()
    for f in files:
        print(f.name, "-", f.size)

    object_name = 'my-file.mp4'
    with open("copy-"+object_name, 'w') as f:
        await obs.get(object_name, f)

    await nc.close()

if __name__ == '__main__':
    asyncio.run(main())
  • Updated the WebSocketTransport to detect the attempt to upgrade the connection to TLS by @allanbank (#443)

Fixed

  • Fixed example from jetstream pull subscriber sample by @csuriano23 (#366)
  • Fixed issue where protocol was changed for ws and wss if no port was
    provided by @bvanelli (#371)
  • Fixed untreated error callbacks when using websockets by @bvanelli (#361 || #375)
  • Fixes to next_msg and tasks cancellation (#446)

Changed

  • Updated signatures for 'servers' and 'discovered_servers' properties by @jonchammer (#374)
  • Move configs from setup.cfg into pyproject.toml by @orsinium (#394)
  • Forbid None for Msg.Metadata fields by @orsinium (#401)
  • Convert republish value into dataclass by @orsinium (#405)
  • Change the type of client_id to int by @kkqy (#435)
  • Raise asyncio.CancelledError back by @charbonnierg (#378)
  • Send credentials even if no_auth_required is set on INFO (#399)
  • Add sid property to nats.aio.msg.Msg class by @charbonnierg (#430)
  • Add custom inbox prefix support for JS pull subscribe by @alparslanavci (#419)

Internal changes

New Contributors