The zaqar.storage.redis.models module

class Message(**kwargs)

Bases: zaqar.storage.redis.models.MessageEnvelope

Represents an entire message, including envelope and body.

Parameters:
  • id – Message ID in the form of a hexadecimal UUID. If not given, one will be automatically generated.
  • ttl – Message TTL in seconds
  • created – Message creation time as a UNIX timestamp
  • client_uuid – UUID of the client that posted the message
  • claim_id – If claimed, the UUID of the claim. Set to None for messages that have never been claimed.
  • claim_expires – Claim expiration as a UNIX timestamp
  • body – Message payload. Must be serializable to mspack.
body
claim_expires
claim_id
client_uuid
created
expires
static from_hmap(hmap)
static from_redis(mid, client)
static from_redis_bulk(message_ids, client)
id
to_basic(now, include_created=False)
to_redis(pipe, include_body=True)
ttl
class MessageEnvelope(**kwargs)

Bases: object

Encapsulates the message envelope (metadata only, no body).

Parameters:
  • id – Message ID in the form of a hexadecimal UUID. If not given, one will be automatically generated.
  • ttl – Message TTL in seconds
  • created – Message creation time as a UNIX timestamp
  • client_uuid – UUID of the client that posted the message
  • claim_id – If claimed, the UUID of the claim. Set to None for messages that have never been claimed.
  • claim_expires – Claim expiration as a UNIX timestamp
claim_expires
claim_id
client_uuid
created
expires
static from_hmap(hmap)
static from_redis(mid, client)
static from_redis_bulk(message_ids, client)
id
to_redis(pipe)
ttl
class SubscriptionEnvelope(**kwargs)

Bases: object

Encapsulates the subscription envelope.

confirmed
expires
static from_redis(sid, client)
id
options
project
source
subscriber
to_basic(now)
to_redis(pipe)
ttl