{"id":16949638,"url":"https://github.com/tailhook/zorro","last_synced_at":"2025-03-22T13:31:18.554Z","repository":{"id":1320131,"uuid":"1265085","full_name":"tailhook/zorro","owner":"tailhook","description":"Network communication library based on greenlets, with zeromq and redis support","archived":false,"fork":false,"pushed_at":"2014-02-10T21:21:40.000Z","size":517,"stargazers_count":43,"open_issues_count":3,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T11:39:05.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tailhook.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-17T22:16:46.000Z","updated_at":"2024-02-06T10:29:20.000Z","dependencies_parsed_at":"2022-07-06T22:03:01.528Z","dependency_job_id":null,"html_url":"https://github.com/tailhook/zorro","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fzorro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fzorro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fzorro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailhook%2Fzorro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tailhook","download_url":"https://codeload.github.com/tailhook/zorro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244962805,"owners_count":20539226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:55:40.829Z","updated_at":"2025-03-22T13:31:18.264Z","avatar_url":"https://github.com/tailhook.png","language":"Python","readme":"=====\nZorro\n=====\n\nThis is mostly networking library. It implements main loop based on greenlets.\nMostly suitable for servers of some kind.\n\nAPI's implemented so far:\n\n* Zeromq\n* Redis\n* MySQL\n* Mongo\n* HTTP/HTTPS (client)\n* DNS (async)\n\nFeatures:\n\n* Only for Python3 (works with 3.2, needs 3.3 for zorro.web)\n* Full set of synchronisation primitives (incl. Futures, Lock, Conditions...)\n* Pipelining for all network protocols\n* Pure python implementation (still outperforms C implementations for many\n  tasks because of pipelining)\n* Basic web framework for zerogw\n* Pluggable polling mechanisms\n\nUsage::\n\n    from zorro import Hub\n\n    hub = Hub()\n    @hub.run\n    def main():\n        # setup other coroutines here\n        return\n\nBasic zmq replier example. Each reply will get it's own microthread::\n\n    from zorro import Hub, zmq\n\n    def replier(preference,*other_multipart_args):\n        if preference == b'binary':\n            return b'hello'\n        elif preference == b'unicode':\n            return 'hello' # same as above, encoded in 'utf-8'\n        elif preference == b'tuple':\n            return 'hello', 'world' # two parts will be sent\n        else:\n            # exeption will be logged, but reply is not sent\n            # so you must timeout on the other side\n            # other requests will be ok (we use ZMQ_XREP actually)\n            raise ValueError(preference)\n\n    hub = Hub()\n    @hub.run\n    def main():\n        sock = zmq.rep_socket(replier)\n        sock.connect('tcp://somewhere')\n\nSome advanced redis usage example::\n\n    from zorro import Hub, redis, Future\n    from functools import partial\n\n    hub = Hub()\n    redis = redis.Redis()\n\n    def getkey(index):\n        # Semi-parallel requests will be pipelined so it's quite fast\n        a = redis.execute('INCR', 'test:{0}'.format(index-1), 1)\n        redis.execute('DECR', 'test:{0}'.format(index+1), a)\n        return int(redis.execute('GET', 'test:{0}'.format(index)))\n\n    @hub.run\n    def main():\n        futures = [Future(partial(getkey, i)) for i in range(100)]\n        print(\"TOTAL\", sum(f.get() for f in futures))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailhook%2Fzorro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftailhook%2Fzorro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailhook%2Fzorro/lists"}