Skip to main content

kafka simple using

Project description

消息队列,基于 beanstalk

You can install pysubman from PyPI with

$ pip install pysubman

Version update

  • 1.10.0 将 kafka 迁移到 beanstalk

Getting Started


#!/usr/bin/env python
# coding=utf-8

import time
import logging
import pysubman

class EMAIL(object):
    Tube = "t-101"
    Topic = "EMAIL"
    Info = [
        ("TemplateUrl", "%s"),
        ("Params", "%s"),

client = pysubman.Producer(beanstalkd_host="")

while True:
    now_time = time.time()
    client.put(EMAIL, "", "chaungwang: {}".format(now_time))


#!/usr/bin/env python
# coding=utf-8

import logging
import pysubman

service = pysubman.Service()

def handler_email_job(body):
    logging.warn(("body", body))

def main():
    consumer = pysubman.Consumer(

if __name__ == "__main__":


  • 根据不同的环境,用户选择不同的slave
  • add retry connecting(bug: interactive_timeout)
  • add is_auto_allocation(Automatic Identification master and slave)
  • Thread Safety


If you need help using pymysqlslave or have found a bug, please open a github issue.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pysubman, version 1.10.1
Filename, size File type Python version Upload date Hashes
Filename, size pysubman-1.10.1-py2.7.egg (10.4 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size pysubman-1.10.1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page