This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

kafka simple using

Project Description

消息队列,基于 redis 或者 beanstalk

You can install pysubman from PyPI with

$ pip install pysubman

Version update

  • 1.20.1.4 处理线程异常
  • 1.20.1.3 修改 redis rpop to brpop
  • 1.20.1.1 添加 redis 消息默认前缀 mq:
  • 1.20.1.0 添加 redis 消息队列, <C-c> 终止处理
  • 1.10.4 添加 Producer put 返回值
  • 1.10.4 添加 beanstalkd;修改 Customer Producer 接口
  • 1.10.2 去掉 logging
  • 1.10.0 将 kafka 迁移到 beanstalk

Getting Started

Producer

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

import json
import time
from pysubman.redis.client import Client

client = Client(host="127.0.0.1:6379:5")
message = json.dumps({
    "type": "linkedin",
    "time": time.time(),
})
client.publish("oauth:linkedin", message)

Customer

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

from pysubman.redis.client import Client
from pysubman.redis.service import Service
from pysubman.redis.subscribe import Subscriber

services = Service()


@services.C("oauth:linkedin")
def handler_email_job(body):
    logging.warn(("body", body))


def main():
    Subscriber(Client(host="127.0.0.1:6379:5")).subscribe(services)


if __name__ == "__main__":
    main()

TODO

  • 添加 tcp 链接超时处理

Support

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

Release History

Release History

This version
History Node

1.20.1.4

History Node

1.20.1.3

History Node

1.20.1.2

History Node

1.20.1.1

History Node

1.20.1.0

History Node

1.10.7

History Node

1.10.6

History Node

1.10.5

History Node

1.10.4

History Node

1.10.3

History Node

1.10.2

History Node

1.10.1

History Node

1.10.0

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysubman-1.20.1.4.tar.gz (9.0 kB) Copy SHA256 Checksum SHA256 Source Dec 8, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting