Skip to main content

serverish - helpers for server alike projects

CI

Features

  • Component management
  • Singletons
  • Connections management and diagnostics
  • NATS based Messenger
  • Live documents - auto-updating configuration from NATS

See doc directory for more documentation.

Optional (extras) dependencies

The following extras are available:

  • messenger - for using NATS based Messenger. Will install nats-py package.
  • dns - for using aiodns DNS resolver for connection status diagnostics, it's extracted as an extra dependency because it's not available on all platforms.

In order to use Messenger, you have to add extra 'messenger' to your project.toml serveris dependency, e.g.:

serverish = {git="https://github.com/AkondLab/serverish.git", extras=["messenger"], branch="master"}

or specify dpendency with extras in the pip convention: serverish[messenger]. this will install nats-py package.

Plans

  • Decorators @messenger.sub(subject) (Web framework style)
  • Progress with automatic increment for known durations e.g. pro_pub.update(completed=1, when=+20)
  • Custom JetStream API replacing nats-py private internals access

Changes

  • 2.3.2 Quieter and more honest logs when the connection is in trouble: an idle reader no longer asks the server about its consumer every 2 s (only the periodic health check does), a warning raised by many readers at once is logged once with a summary of the rest, Messenger.open() giving up logs one warning (no traceback, no false "backgrounding"). Messenger.is_open is true on a server which stores nothing yet. After a failed open() the Messenger is closed, so open() can be called again.
  • 2.3.1 Subjects, not streams: get_publisher(subject, persistent=True) guarantees that published means stored (MessengerNotPersisted, checked on open()); publishing to a subject nobody stores now warns instead of passing silently. Subject families (family=True on readers: a subject and everything below it) and get_kvreader(..., nowait=True). See Subjects. Removed the unused MsgReader.next_msg() (an orphaned internal helper returning raw client-library messages; use read_next()).
  • 2.3 Breaking: exceptions of the NATS client library (nats.errors.*) no longer leak from the Messenger API - every error is a ServerishError (see Error handling). Replace except nats.errors... handlers around serverish calls. raise_on_publish_error=False covers a missing connection too.
  • 1.7 Subscription reliability: reader auto-recovers from NATS disconnects and consumer expiry, RPC responder auto-resubscribes, health_status property on all drivers (reader, publisher, RPC responder, connection) with reconnect counts, error tracking, slow consumer detection. Comprehensive test suite (194 tests) with testcontainers-based NATS fixtures.
  • 1.5 Introduces live documents (LiveDocument, get_documentreader(), get_live_document()) for auto-updating configuration from NATS.
  • 1.4 Contains improvements to the network problems recovery and connection tracking.
  • 1.1 Switches to param 2.* nad py-nats 1.7.*. Also, publisher may reraise exceptions or ignore them.
  • 1.0 Changes NATS subscriptions to pull only
  • 0.12 Extends messges metdata of nats section, Handles reconnection of subscriptions,
  • 0.11 Extends, tasks, NATS connection tracking and messenger opening options (Messenger.open)
  • 0.10 Adds timestamp to journal messages and extablishes schema for journal messages.
  • 0.9.1 Makes dependency to aiodns optional.
  • 0.9.0 Introduces Logging handler for passing standard logging messages to the Messenger.
  • 0.8 Introduces journal publishing/reading API.
  • 0.7 Includes progress tracking messages in the Messenger API.
  • 0.6 introduces breaking changes in the Messenger API:
    • Convenience functions get_xxxxx() returning publishers/readers are synchronous now. Remove await-ing for their results.
    • Change of signature of the callback for MsgRpcResponder.register_function for Rpc->None.

Credits

This package uses some code and ideas from the rich package (Copyright (c) 2020 Will McGugan).

Metadata

Release files for serverish 2.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serverish 2.3.2
File Size Uploaded Provenance Actions
serverish-2.3.2.tar.gz 78.9 kB Without provenance Details for serverish-2.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serverish 2.3.2
File Interpreter ABI Platform Actions
serverish-2.3.2-py3-none-any.whl Python 3 none any Details for serverish-2.3.2-py3-none-any.whl

Total release size: 186.6 kB

Release files / serverish-2.3.2.tar.gz

Download URL serverish-2.3.2.tar.gz
Size 78.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a13d49b692f1aa221fc60374ba088b95e041f80428c5b39918639dd8732b245a
BLAKE2b-256 checksum
How to use checksums
388441d5d41c57d3e287c630e6313c5a16339a194118d906b3810f7e5bb2c1eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.12 Darwin/27.0.0

Release files / serverish-2.3.2-py3-none-any.whl

Download URL serverish-2.3.2-py3-none-any.whl
Size 107.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66c83b5dfd4f39545f6b03d981256ec9bbfdfa527f74faef72f0f3fdf0aeaad6
BLAKE2b-256 checksum
How to use checksums
9cba40c43b90837afd48440665b47b4f48f913247d9029ef473f6faca4dc3567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.12 Darwin/27.0.0

Security for serverish 2.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page