Skip to main content

taskiq-memphis

This library provides you with memphis broker for taskiq. You need python version >=3.8

Usage:

from taskiq_memphis import MemphisBroker

broker = MemphisBroker(
    memphis_host="localhost",
    username="root",
    password="memphis",
)


@broker.task
async def the_best_task_ever() -> None:
    print("The best task ever")

Configuration

MemphisBroker parameters:

  • memphis_host - host to memphis.
  • port - memphis server port.
  • username - username.
  • connection_token - connection token.
  • password - password for username.
  • result_backend - custom result backend.
  • task_id_generator - custom task_id genertaor.
  • reconnect - turn on/off reconnection while connection is lost.
  • max_reconnect - maximum reconnection attempts.
  • reconnect_interval_ms - interval in milliseconds between reconnect attempts.
  • timeout_ms - connection timeout in milliseconds.
  • cert_file - path to tls cert file.
  • key_file - path to tls key file.
  • ca_file - path to tls ca file.
  • consumer_batch_size - batch size for the consumer.
  • destroy_station_on_shutdown - close station on shutdown.
  • destroy_producer_on_shutdown - close producer on shutdown.
  • destroy_consumer_on_shutdown - close consumer on shutdown.

Non-obvious things

You can configure memphis topic, consumer, producer and produce method with:

# Create broker
broker = MemphisBroker(
    memphis_host="localhost",
    username="root",
    password="memphis",
    destroy_station_on_shutdown=True,
)

# Configure station
broker.configure_station(...)

# Configure producer
broker.configure_producer(...)

# Configure produce method
broker.configure_produce_method(...)

# Configure consumer
broker.configure_consumer(...)

Memphis station parameters you can configure:

  • name - name of the station. Required.
  • retention_type - type of message retention.
  • retention_value - how long it takes to keep message, based on retention_type.
  • storage_type - type of the storage, DISK or MEMORY.
  • replicas - number of replicas.
  • idempotency_window_ms - time frame in which idempotent messages will be tracked.
  • schema_name - name of the schema. (You can create it only via memphis UI now)
  • send_poison_msg_to_dls - send poisoned message to dead letter station or not.
  • send_schema_failed_msg_to_dls - send schema failed message to dead letter station or not.
  • tiered_storage_enabled - tiered storage enabled or not.

Memphis producer parameters you can configure:

  • producer_name - producer name. Required.
  • generate_random_suffix - add suffix to producer name. Default - True. DON'T SET THIS VARIABLE TO FALSE IF YOU WANT TO USE MORE THAN ONE PRODUCER.

Memphis produce method parameters you can configure:

  • ack_wait_sec - wait ack time in seconds.
  • headers - Headers instance from memphis.
  • async_produce - produce message in async way or not.

Memphis consumer parameters you can configure:

  • consumer_name - name of the consumer. Required.
  • consumer_group - name of the consumer group.
  • pull_interval_ms - interval in milliseconds between pulls.
  • batch_size - pull batch size.
  • batch_max_time_to_wait_ms - max time in milliseconds to wait between pulls.
  • max_ack_time_ms - max time for ack a message in milliseconds.
  • max_msg_deliveries - max number of message deliveries.
  • generate_random_suffix - concatenate a random suffix to consumer's name. DON'T SET THIS VARIABLE TO FALSE IF YOU WANT TO USE MORE THAN ONE CONSUMER.
  • start_consume_from_sequence - start consuming from a specific sequence.
  • last_messages - consume the last N messages.

Metadata

Release files for taskiq-memphis 0.2.0

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

Source distribution (sdist)

Source distribution for taskiq-memphis 0.2.0
File Size Uploaded
taskiq_memphis-0.2.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for taskiq-memphis 0.2.0
File Interpreter ABI Platform
taskiq_memphis-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / taskiq_memphis-0.2.0.tar.gz

Download URL taskiq_memphis-0.2.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
47bd6e737733f0e97dd965e1fef5b37d9f4015316d7fa5cb3250077ef08232e5
BLAKE2b-256 checksum
How to use checksums
1ab1238e44ad6256fd07a11a6e180f24d4654e0cbef0b197f07fb25dc442ba61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-1038-azure

Release files / taskiq_memphis-0.2.0-py3-none-any.whl

Download URL taskiq_memphis-0.2.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29dd06407136f55452470ac737cb82b6624b987c526dde1a533dfe8966c8399c
BLAKE2b-256 checksum
How to use checksums
b6128691cb405ae496ba1f4df463d814cdcf59bda90719ec6eb4e34d1156a67b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-1038-azure

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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