{"id":55086,"date":"2020-01-12T00:00:00","date_gmt":"2020-01-11T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha"},"modified":"2020-02-18T14:03:10","modified_gmt":"2020-02-18T11:03:10","slug":"osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha","title":{"rendered":"\u041e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zmq \u0432 python, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>\n\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h4>\n<p>\n\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<br \/>\n<code>sudo apt-get install libzmq-dev<\/code><br \/>\n<code>sudo pip install zmq<\/code><\/p>\n<h4>\u041a\u043e\u0434<\/h4>\n<p>\n\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0448\u0438\u043c <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/server\/dts-prohoster\"   title=\"\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"2988\">\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c<\/a>:<br \/>\n\u0422\u0438\u043f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e zmq-\u0441\u043e\u043a\u0435\u0442\u0430 \u2014 REQ(REQuest, \u0437\u0430\u043f\u0440\u043e\u0441), \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0436\u0434\u0435\u043c \u043e\u0442\u0432\u0435\u0442.<br \/>\n\u0427\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c pickle. \u00ab\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u00bb \u0440\u0430\u0431\u043e\u0442\u044b \u2014 \u043a\u043e\u0440\u0442\u0435\u0436 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439: (\u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043b\u044e\u0447, \u0434\u0430\u043d\u043d\u044b\u0435)<\/p>\n<pre><code class=\"python\">import zmq\nimport pickle\n\nclass SuperCacher:\n    def __init__(self):\n        context = zmq.Context()\n        self.socket = context.socket(zmq.REQ)\n        self.socket.connect('tcp:\/\/127.0.0.1:43000')\n\n    def get(self, key):\n        self.socket.send(pickle.dumps(('get', key, None)))\n        return pickle.loads(self.socket.recv())\n\n    def set(self, key, data):\n        self.socket.send(pickle.dumps(('set', key, data)))\n        return self.socket.recv() == b'ok'\n<\/code><\/pre>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h5>\n<p>\ncache = SuperCacher()<br \/>\ncache.set(&#8216;key&#8217;, &#8216;value&#8217;)<br \/>\ncache.get(&#8216;key&#8217;)<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u2014 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441\/\u043f\u043e\u0440\u0442 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/server\"   title=\"\u0441\u0435\u0440\u0432\u0435\u0440\" data-wpil-keyword-link=\"linked\">\u0441\u0435\u0440\u0432\u0435\u0440<\/a>.<br \/>\n\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0435\u0442 REP(REPly, \u043e\u0442\u0432\u0435\u0442) \u2014 \u0436\u0434\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u0448\u043b\u0435\u043c \u043e\u0442\u0432\u0435\u0442. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043b\u0438\u0431\u043e &#8216;ok&#8217; \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \/ None \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">import pickle\nimport json\nimport zmq\n\ndef run_daemon():\n    memory = {}\n\n    context = zmq.Context()\n    socket = context.socket(zmq.REP)\n    socket.bind('tcp:\/\/127.0.0.1:43000')\n\n    while True:\n        try:\n            command, key, data = pickle.loads(socket.recv())\n            if command == 'set':\n                memory[key] = data\n                socket.send(b'ok')\n            elif command == 'get':\n                result = memory.get(key, None)\n                socket.send(pickle.dumps(result))\n        except Exception as e:\n            print(e)\n\nif __name__ == '__main__':\n    run_daemon()\n<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<br \/>\n<code>python daemon.py<\/code><\/p>\n<p>\u0412 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c python \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; from lib import SuperCacher\n&gt;&gt;&gt; cache=SuperCacher()\n&gt;&gt;&gt; cache.set('key', 'value')\nTrue\n&gt;&gt;&gt; cache.get('key')\n'value'\n<\/code><\/pre>\n<p>\u041e \u0447\u0443\u0434\u043e, \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435\u043c \u0440\u0435\u0437\u044e\u043c\u0435 \u00ab\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 key-value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 zmq\u00bb<br \/>\n<br \/>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/483586\/\">habr.com<\/a><\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 sudo apt-get install libzmq-dev sudo [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-55086","post","type-post","status-publish","format-standard","hentry","category-novosti-interneta"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 sudo apt-get install libzmq-dev sudo\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zmq \u0432 python, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 sudo apt-get install libzmq-dev sudo\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-01-11T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:03:10+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47\u041e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zmq \u0432 python, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 | ProHoster","description":"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 sudo apt-get install libzmq-dev sudo","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zmq \u0432 python, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 | ProHoster","og:description":"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e key\/value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a memcache. \u0423\u0441\u0442\u0440\u043e\u0435\u043d \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 hashmap. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tcp-\u0441\u043e\u043a\u0435\u0442. \u0412 \u043f\u0438\u0442\u043e\u043d\u0435 hashmap \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 dict. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c zeromq. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 debian\/ubuntu \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 sudo apt-get install libzmq-dev sudo","og:url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/osnovy-raboty-s-zmq-v-python-sozdanie-prostogo-key-value-hranilishha","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-01-11T21:00:00+00:00","article:modified_time":"2020-02-18T11:03:10+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"55086","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 19:51:57","updated":"2026-02-09 21:46:33"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/55086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=55086"}],"version-history":[{"count":2,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/55086\/revisions"}],"predecessor-version":[{"id":172871,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/55086\/revisions\/172871"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=55086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=55086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=55086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}