Giter Site home page Giter Site logo

libuq's Introduction

UQ Cluster library

UQ is a distributed persistent message queue. Libuq is the programing language bindings for uq cluster.

Progress

Name Language Author
UQ HTTP built-in
gouq Go official
juq Java sumory
phpuq PHP coming soon
pyuq Python amyangfei
... ... TODO

gouq

Gouq is the golang library for uq cluster. To use gouq, import the github package in your program:

import (
	"github.com/buaazp/libuq/gouq"
)

Then new a client:

// for single uq instance
c, err = uq.NewClient(protocol, ip, port)
// for multi instances in a cluster
c, err = uq.NewClientEtcd(protocol, etcdServers, cluster)

And use the queue methods like:

err = c.Add(topic, line, recycle)
err = c.Push(topic, value)
id, data, err := c.Pop(key)
err = c.Del(id)

Gouq library will automatically choose the instance online to deal with the queue methods. You needn't to worry about the connections and etcd results.

For more information, take a look at Godoc.org:

https://godoc.org/github.com/buaazp/libuq/gouq

You can also read the sample code in examples/go-uq.go. To run the sample:

go build examples/go-uq.go
./go-uq -h
Usage of ./go-uq:
  -cluster="uq": cluster name in etcd
  -etcd="": etcd service location
  -ip="127.0.0.1": uq server ip address
  -line="x": line name
  -port=8808: uq server port
  -protocol="redis": frontend interface(redis, mc, http)
  -topic="foo": topic name

juq

Juq is the Java library of uq cluster, Juq use redis client - aredis, and modify it to support commands from uq

//package org.aredis.cache
public enum RedisCommand {

    //###### modified by sumory for uq ######
    ADD("kk"), DEL("k"),
    //DEL("k@k", false, false, IntegerShardedResultHandler.instance),
    //###### modified by sumory for uq ######
    ...
}

Goto the tests for usage detail.

pyuq

PyUQ is a python client library for uq cluster supporting the http/redis/memcache based protocol. Pyuq is compatible with python 2.7/3.4/3.5

To install pyuq, simply:

$ pip install uq

Goto examples and tests for usage detail.

Need Contributions

Implement all language bindings for uq cluster is a huge work to me. I really need your contributions to build a full-language uq cluster library. If you are good at some languages, php, python or any other, please make a PR to give some help.

libuq's People

Contributors

amyangfei avatar buaazp avatar sumory avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

sumory jmptrader

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.