Giter Club home page Giter Club logo

woof's Introduction

Woof

Persistent messaging at scale

Introduction

Persistent messaging library which offers various flavors of messaging; optimizing for throughput, latency etc

Currently there is support for paritioned , persistent queues which use Apache Kafka as the backend. Future work will include low-latency messaging.

Installation

  • Install requirements for woof.
pip install -r requirements.txt
  • Install woof package
python setup.py install

Sample Usage

Producer

import sys
import os
import logging
from woof.producer import FeedProducer

fp = FeedProducer(server)
msg = "this"
fp.send(topic, " [MY MESSAGE] %s" %(msg))

Keyed/Partitioned Producer

import sys
import os
import logging
from woof.partitioned_producer import PartitionedProducer

pp = PartitionedProducer(server)
pp.send(topic = topic_name, value=message_value, key=message_key)

Consumer

import time, sys, logging, os
from woof.consumer import FeedConsumer

# Callback function executed for eah message.
# Arg1 - msg.key
# Arg2 - msg.value
def dummy(key, value):
    print(key + ":" + value)

fc = FeedConsumer(broker='kafka_broker_ip:kafka_broker_port',  group ='TestGroup')
fc.add_topic(topic, dummy)
fc.run()

time.sleep(60) // This is just to avoid the process exiting

woof's People

Contributors

cookingkode avatar sudev avatar namitsingal avatar vikalp avatar amanankur avatar soumyamandi14 avatar avinash011 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.