{"id":47090,"date":"2022-12-11T21:28:06","date_gmt":"2023-08-13T11:55:23","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/"},"modified":"2024-04-29T04:48:22","modified_gmt":"2024-04-28T20:48:22","slug":"%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/","title":{"rendered":"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<p>\u6211\u5728\u300a\u5165\u95e8Python3\u300b\u4e2d\u4e86\u89e3\u5230\u4e86Python\u7684gevent\u5e93\uff0c\u53c2\u8003\u4e86\u5b98\u65b9\u6587\u6863\u7b49\u8d44\u6599\u5e76\u5b66\u4e60\u4e86\u4e00\u4e9b\u77e5\u8bc6\uff0c\u6211\u5c06\u5176\u6574\u7406\u6210\u4e86\u5907\u5fd8\u5f55\u3002<\/p>\n<h1>\u5173\u4e8egevent\u5e93<\/h1>\n<p>gevent\u5e93\u91c7\u7528\u4e8b\u4ef6\u9a71\u52a8\u65b9\u5f0f\uff0c\u5f53\u7f16\u5199\u5e38\u89c4\u7684\u547d\u4ee4\u5f0f\u4ee3\u7801\u65f6\uff0cgevent\u4f1a\u50cf\u9b54\u672f\u4e00\u6837\u5c06\u7ec4\u4ef6\u8f6c\u6362\u4e3a\u534f\u7a0b(\u6ce81)\u3002<br \/>\n\u5b83\u50cf\u751f\u6210\u5668\u4e00\u6837\u8fd0\u884c\uff0c\u80fd\u591f\u4e92\u76f8\u901a\u4fe1\u5e76\u6301\u7eed\u8ffd\u8e2a\u5bf9\u65b9\u7684\u4f4d\u7f6e\u3002<br \/>\ngevent\u4fee\u6539\u4e86\u8bb8\u591aPython\u6807\u51c6\u5bf9\u8c61\uff0c\u5982socket\u7b49\uff0c\u4ee5\u4fbf\u4e8e\u4f7f\u7528gevent\u7684\u673a\u5236\u800c\u4e0d\u53d1\u751f\u963b\u585e\u3002<\/p>\n<blockquote><p>(\u6ce81.) \u534f\u7a0b\u662f\u4e00\u79cd\u4e2d\u65ad\u548c\u6062\u590d\u5904\u7406\u7684\u673a\u5236\u3002<br \/>\n\u4e0e\u5e38\u89c4\u51fd\u6570\u4e0d\u540c\u7684\u7279\u70b9\u662f\uff0c\u5728\u5904\u7406\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u4e2d\u65ad\uff0c\u5e76\u4ece\u4e2d\u65ad\u70b9\u91cd\u65b0\u5f00\u59cb\u5904\u7406\u3002<\/p><\/blockquote>\n<h3>\u5173\u4e8e\u4e8b\u4ef6\u9a71\u52a8\u7f16\u7a0b\u3002<\/h3>\n<p>\u8fd9\u4efd\u8d44\u6599\u975e\u5e38\u6e05\u6670\u6613\u61c2\uff0c\u6211\u4ece\u4e2d\u5f97\u5230\u4e86\u5f88\u591a\u53c2\u8003\u3002<\/p>\n<blockquote><p>\u4f7f\u7528Apache Kafka on Heroku\u8bbe\u8ba1\u548c\u5b9e\u65bd\u4e8b\u4ef6\u9a71\u52a8\u67b6\u6784<\/p><\/blockquote>\n<h3>gevent\u662f\u4ec0\u4e48\uff1f<\/h3>\n<p>gevent\u662f\u4e00\u4e2a\u57fa\u4e8e\u534f\u7a0b\u7684Python\u7f51\u7edc\u7f16\u7a0b\u5e93\u3002<\/p>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u901a\u8fc7\u68c0\u67e5\u793a\u4f8b\u4ee3\u7801\u6765\u52a0\u6df1\u6211\u4eec\u5bf9gevent\u4ee5\u4e0b\u529f\u80fd\u7684\u7406\u89e3\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b0\u30ea\u30fc\u30f3\u30ec\u30c3\u30c8\u306b\u57fa\u3065\u304f\u8efd\u91cf\u306e\u5b9f\u884c\u30e6\u30cb\u30c3\u30c8<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u5bfe\u3057\u3066\u30e2\u30f3\u30ad\u30fc\u30d1\u30c3\u30c1\u3092\u9069\u5fdc<\/ul>\n<h2>\u793a\u4f8b\u4ee3\u7801<\/h2>\n<h3>\u7eff\u8272\u5c0f\u751f\u83dc\u7684\u529f\u80fd<\/h3>\n<pre class=\"post-pre\"><code><span class=\"kn\">import<\/span> <span class=\"nn\">gevent<\/span>\r\n<span class=\"kn\">from<\/span> <span class=\"nn\">gevent<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">socket<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"n\">__name__<\/span> <span class=\"o\">==<\/span> <span class=\"s\">\"__main__\"<\/span><span class=\"p\">:<\/span>\r\n    <span class=\"n\">hosts<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span><span class=\"s\">'www.google.com'<\/span><span class=\"p\">,<\/span><span class=\"s\">'www.yahoo.co.jp'<\/span><span class=\"p\">,<\/span><span class=\"s\">'www.qiita.com'<\/span><span class=\"p\">]<\/span>\r\n    <span class=\"n\">jobs<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span><span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">spawn<\/span><span class=\"p\">(<\/span><span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">socket<\/span><span class=\"p\">.<\/span><span class=\"n\">gethostbyname<\/span><span class=\"p\">,<\/span><span class=\"n\">host<\/span><span class=\"p\">)<\/span> <span class=\"k\">for<\/span> <span class=\"n\">host<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">hosts<\/span><span class=\"p\">]<\/span>\r\n    <span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">joinall<\/span><span class=\"p\">(<\/span><span class=\"n\">jobs<\/span><span class=\"p\">,<\/span><span class=\"n\">timeout<\/span><span class=\"o\">=<\/span><span class=\"mi\">5<\/span><span class=\"p\">)<\/span>\r\n\r\n    <span class=\"c1\"># \u30db\u30b9\u30c8\u540d\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u51fa\u529b\r\n<\/span>    <span class=\"k\">for<\/span> <span class=\"n\">job<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">jobs<\/span><span class=\"p\">:<\/span>\r\n        <span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">job<\/span><span class=\"p\">.<\/span><span class=\"n\">value<\/span><span class=\"p\">)<\/span>\r\n\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> python gevent_test.py\r\n<span class=\"go\">216.58.197.196\r\n182.22.25.252\r\n52.196.217.245\r\n<\/span><\/code><\/pre>\n<h4>\u89e3\u91ca<\/h4>\n<p>socket\u6a21\u5757\u7684gethostbyname()\u51fd\u6570\u7528\u4e8e\u8fd4\u56de\u4e0e\u57df\u540d\u5bf9\u5e94\u7684IP\u5730\u5740\u3002\u7531\u4e8e\u662f\u540c\u6b65\u7684\uff0c\u5f53\u5c1d\u8bd5\u89e3\u6790\u5730\u5740\u65f6\uff0c\u5b83\u4f1a\u7b49\u5f85\u5e76\u7ade\u4e89\u6293\u53d6\u4e16\u754c\u5404\u5730\u7684\u547d\u540d\u670d\u52a1\u5668\u3002\u4f46\u662f\uff0c\u5982\u679c\u4f7f\u7528gevent\u7248\u672c\uff0c\u53ef\u4ee5\u5f02\u6b65\u6267\u884c\u5e76\u72ec\u7acb\u5730\u89e3\u6790\u591a\u4e2a\u7f51\u7ad9\u3002<\/p>\n<p>gevent.spawn()\u51fd\u6570\u7528\u4e8e\u521b\u5efa\u534f\u7a0b\uff08\u4e5f\u79f0\u4e3agreenlet\u3001\u5fae\u7ebf\u7a0b\uff09\uff0c\u4ee5\u6267\u884c\u6bcf\u4e2agevent.socket.gethostbyname(url)\u7684\u64cd\u4f5c\u3002<br \/>\n\u4e0e\u666e\u901a\u7ebf\u7a0b\u7684\u533a\u522b\u5728\u4e8e\uff0c\u534f\u7a0b\u4e0d\u4f1a\u963b\u585e\u3002\u963b\u585e\u5904\u7406\u662f\u6307\u5176\u4ed6\u7ebf\u7a0b\u65e0\u6cd5\u8bbf\u95ee\u8d44\u6e90\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e5f\u79f0\u4e3a\u4e92\u65a5\u5904\u7406\u6216\u4e92\u65a5\u63a7\u5236\u3002\u5373\u4f7f\u51fa\u73b0\u4f1a\u5bfc\u81f4\u666e\u901a\u7ebf\u7a0b\u963b\u585e\u7684\u60c5\u51b5\uff0cgevent\u4e5f\u4f1a\u5207\u6362\u5230\u5176\u4ed6\u534f\u7a0b\u6765\u8fdb\u884c\u63a7\u5236\u3002<\/p>\n<p>gevent.joinall()\u65b9\u6cd5\u4f1a\u7b49\u5f85\u6240\u6709\u6d3e\u751f\u51fa\u6765\u7684\u4efb\u52a1\u90fd\u7ed3\u675f\u3002<\/p>\n<h3>gevent\u5e93\u4e2d\u7684Monkey Patch\u529f\u80fd<\/h3>\n<p>\u53ef\u4ee5\u4f7f\u7528Monkey Patching\u51fd\u6570\u6765\u66ff\u4ee3gevent\u7248\u672c\u7684socket\u3002<br \/>\n\u8fd9\u4e9b\u51fd\u6570\u4f1a\u4fee\u6539\u6807\u51c6\u6a21\u5757\uff0c\u5982socket\uff0c\u800c\u4e0d\u662f\u8c03\u7528gevent\u7248\u672c\u7684\u6a21\u5757\u6765\u4f7f\u7528greenlet\u3002<br \/>\n\u8fd9\u5728Python\u4ee3\u7801\u4e0a\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u4e0d\u9002\u7528\u4e8e\u4f7f\u7528C\u7f16\u5199\u7684\u5e93\u3002<\/p>\n<h4>\u5173\u4e8eMonkey Patching<\/h4>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5143\u306e\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u52d5\u7684\u306b\u30b3\u30fc\u30c9\u3092\u62e1\u5f35\/\u5909\u66f4\u3059\u308b\u4e8b\u306e\u7dcf\u79f0\u306e\u3053\u3068\uff0e(\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u4e00\u7a2e)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30b3\u30fc\u30c9\u3092\u76f4\u63a5\u5909\u3048\u305f\u304f\u306a\u3044\u6642\u3068\u304b\u306b\u5229\u7528\u3055\u308c\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30c6\u30b9\u30c8\u7cfb\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3088\u304f\u5229\u7528\u3055\u308c\u308b<\/ul>\n<pre class=\"post-pre\"><code><span class=\"kn\">import<\/span> <span class=\"nn\">gevent<\/span>\r\n<span class=\"kn\">from<\/span> <span class=\"nn\">gevent<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">monkey<\/span><span class=\"p\">;<\/span><span class=\"n\">monkey<\/span><span class=\"p\">.<\/span><span class=\"n\">patch_all<\/span><span class=\"p\">()<\/span>\r\n<span class=\"kn\">import<\/span> <span class=\"nn\">socket<\/span>\r\n<span class=\"kn\">import<\/span> <span class=\"nn\">time<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"n\">__name__<\/span> <span class=\"o\">==<\/span> <span class=\"s\">\"__main__\"<\/span><span class=\"p\">:<\/span>\r\n\r\n    <span class=\"n\">hosts<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span><span class=\"s\">'www.google.com'<\/span><span class=\"p\">,<\/span><span class=\"s\">'www.yahoo.co.jp'<\/span><span class=\"p\">,<\/span><span class=\"s\">'www.qiita.com'<\/span><span class=\"p\">]<\/span>\r\n    <span class=\"c1\">#gevent.spawn()\u306e\u5f15\u6570\u306b\u306fsocket.gethostbyname\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u304c\uff0c\u3053\u3053\u304c\u30e2\u30f3\u30ad\u30fc\u30d1\u30c3\u30c1\u30f3\u30b0\u5bfe\u8c61\r\n<\/span>    <span class=\"n\">jobs<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span><span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">spawn<\/span><span class=\"p\">(<\/span><span class=\"n\">socket<\/span><span class=\"p\">.<\/span><span class=\"n\">gethostbyname<\/span><span class=\"p\">,<\/span><span class=\"n\">host<\/span><span class=\"p\">)<\/span> <span class=\"k\">for<\/span> <span class=\"n\">host<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">hosts<\/span><span class=\"p\">]<\/span>\r\n    <span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">joinall<\/span><span class=\"p\">(<\/span><span class=\"n\">jobs<\/span><span class=\"p\">,<\/span><span class=\"n\">timeout<\/span><span class=\"o\">=<\/span><span class=\"mi\">5<\/span><span class=\"p\">)<\/span>\r\n    <span class=\"n\">gevent<\/span><span class=\"p\">.<\/span><span class=\"n\">spawn<\/span><span class=\"p\">()<\/span>\r\n\r\n    <span class=\"k\">for<\/span> <span class=\"n\">job<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">jobs<\/span><span class=\"p\">:<\/span>\r\n        <span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">job<\/span><span class=\"p\">.<\/span><span class=\"n\">value<\/span><span class=\"p\">)<\/span>\r\n<\/code><\/pre>\n<h4>\u89e3\u91ca<\/h4>\n<p>\u5728genvent_test.py\u4e2d\uff0c\u660e\u786e\u5bfc\u5165\u4e86gevent.socket\u6a21\u5757\u3002<br \/>\n\u53e6\u4e00\u65b9\u9762\uff0c\u5728gevent_monkey.py\u4e2d\uff0c\u660e\u786e\u5bfc\u5165\u4e86\u6807\u51c6\u5e93\u7684socket\u6a21\u5757\u3002\u5982\u679c\u4e0d\u4f7f\u7528monkey.patch_all()\u51fd\u6570\uff0c\u5728\u5bfc\u5165socket\u6a21\u5757\u7684\u9636\u6bb5\uff0c\u5bfc\u5165\u7684\u5c06\u662f\u6807\u51c6\u5e93\u7684socket\u6a21\u5757\uff0c\u800c\u4e0d\u662fgevent\u7248\u7684socket\u6a21\u5757\u3002<br \/>\n\u901a\u8fc7\u4f7f\u7528monkey.patch_all()\u51fd\u6570\uff08\u793a\u4f8b\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u662fmonkey.patch_all()\uff09\uff0c\u53ef\u4ee5\u5c06\u6807\u51c6\u5e93\u66ff\u6362\u4e3agevent\u7248\u7684socket\u6a21\u5757\u3002<\/p>\n<h1>\u611f\u53d7<\/h1>\n<p>\u8fd9\u91cc\u6240\u63cf\u8ff0\u7684\u5185\u5bb9\u5b8c\u5168\u4e0d\u5b9e\u9645\uff0c\u800c\u4e14\u6211\u60f3\u8fdb\u4e00\u6b65\u8c03\u67e5\u3002<br \/>\n\u8ba1\u5212\u6dfb\u52a0\u6211\u901a\u8fc7\u8c03\u67e5\u5f97\u5230\u7684\u4fe1\u606f\u3002<\/p>\n<h1>\u6587\u732e\u5f15\u7528<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5165\u9580Python3<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">http:\/\/www.gevent.org\/<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u5728\u300a\u5165\u95e8Python3\u300b\u4e2d\u4e86\u89e3\u5230\u4e86Python\u7684gevent\u5e93\uff0c\u53c2\u8003\u4e86\u5b98\u65b9\u6587\u6863\u7b49\u8d44\u6599\u5e76\u5b66\u4e60\u4e86\u4e00\u4e9b\u77e5\u8bc6\uff0c [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-47090","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u3010python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u6211\u5728\u300a\u5165\u95e8Python3\u300b\u4e2d\u4e86\u89e3\u5230\u4e86Python\u7684gevent\u5e93\uff0c\u53c2\u8003\u4e86\u5b98\u65b9\u6587\u6863\u7b49\u8d44\u6599\u5e76\u5b66\u4e60\u4e86\u4e00\u4e9b\u77e5\u8bc6\uff0c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u3010python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-13T11:55:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T20:48:22+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/\",\"name\":\"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-13T11:55:23+00:00\",\"dateModified\":\"2024-04-28T20:48:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u3010python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\/","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9","og_description":"\u9996\u5148 \u6211\u5728\u300a\u5165\u95e8Python3\u300b\u4e2d\u4e86\u89e3\u5230\u4e86Python\u7684gevent\u5e93\uff0c\u53c2\u8003\u4e86\u5b98\u65b9\u6587\u6863\u7b49\u8d44\u6599\u5e76\u5b66\u4e60\u4e86\u4e00\u4e9b\u77e5\u8bc6\uff0c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u3010python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-13T11:55:23+00:00","article_modified_time":"2024-04-28T20:48:22+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/","name":"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-13T11:55:23+00:00","dateModified":"2024-04-28T20:48:22+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Python\u3011\u6574\u7406\u4e00\u4e0b\u5173\u4e8egevent\u5e93\u7684\u7b80\u8981\u5185\u5bb9"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e3%80%90python%e3%80%91%e6%95%b4%e7%90%86%e4%b8%80%e4%b8%8b%e5%85%b3%e4%ba%8egevent%e5%ba%93%e7%9a%84%e7%ae%80%e8%a6%81%e5%86%85%e5%ae%b9\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/47090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=47090"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/47090\/revisions"}],"predecessor-version":[{"id":82951,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/47090\/revisions\/82951"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=47090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=47090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=47090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}