Release v2.3.0
pip install nats-py
Added
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
- Sort imports by @orsinium (#385)
- Make all type annotations lazy by @orsinium (#386)
- Use the new type annotations syntax by @orsinium (#388)
- Fixed incorrect formatting in
.travis.yml
by @WillCodeCo (#420)
New Contributors
- @csuriano23 made their first contribution in #366
- @jonchammer made their first contribution in #374
- @WillCodeCo made their first contribution in #420
- @allanbank made their first contribution in #443
- @kkqy made their first contribution in #435
- @alparslanavci made their first contribution in #419