{"id":1025,"date":"2021-10-11T22:04:34","date_gmt":"2021-10-11T14:04:34","guid":{"rendered":"https:\/\/fireinsect.top\/?p=1025"},"modified":"2021-11-04T21:19:42","modified_gmt":"2021-11-04T13:19:42","slug":"%e5%b9%b6%e5%8f%91%e5%ae%b9%e5%99%a8%e5%92%8c%e7%ba%bf%e7%a8%8b%e6%b1%a0","status":"publish","type":"post","link":"https:\/\/fireinsect.top\/index.php\/2021\/10\/11\/%e5%b9%b6%e5%8f%91%e5%ae%b9%e5%99%a8%e5%92%8c%e7%ba%bf%e7%a8%8b%e6%b1%a0\/","title":{"rendered":"\u5e76\u53d1\u5bb9\u5668\u548c\u7ebf\u7a0b\u6c60"},"content":{"rendered":"\n<p>\u5f53\u4f60\u7684\u7ebf\u7a0b\u9700\u8981\u6267\u884c\u4e00\u4e2a\u540e\u7ee7\u4efb\u52a1\uff0c\u5373\u5b8c\u6210\u6bcf\u4e2a\u524d\u7f6e\u4efb\u52a1\u540e\uff0c\u4f1a\u81ea\u52a8\u6267\u884c\u4e0b\u4e00\u4e2a\u4efb\u52a1\u3002\u8fd9\u65f6\u6211\u4eec\u4f7f\u7528<code>CompletableFuture<\/code> \u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p><code>CompletableFuture<\/code>\u00a0\u662f\u4e00\u4e2a\u5f02\u6b65\u4efb\u52a1\u7f16\u6392\u3001\u8c03\u5ea6\u6846\u67b6\uff0c\u4ee5\u66f4\u4f18\u96c5\u7684\u65b9\u5f0f\u5b9e\u73b0\u7ec4\u5408\u5f0f\u5f02\u6b65\u7f16\u7a0b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>ps\uff1a\u5982\u679c\u7a0b\u5e8f\u8c03\u7528\u67d0\u4e2a\u65b9\u6cd5\uff0c\u7b49\u5f85\u5176\u6267\u884c\u5168\u90e8\u5904\u7406\u540e\u624d\u80fd\u7ee7\u7eed\u6267\u884c\uff0c\u6211\u4eec\u79f0\u5176\u4e3a<strong>\u540c\u6b65<\/strong>\u7684\u3002\u76f8\u53cd\uff0c\u5728\u5904\u7406\u5b8c\u6210\u4e4b\u524d\u5c31\u8fd4\u56de\u8c03\u7528\u65b9\u6cd5\u5219\u662f<strong>\u5f02\u6b65<\/strong>\u7684\u3002<br>\u6211\u4eec\u5728\u7f16\u7a0b\u8bed\u8a00\u7684\u6d41\u7a0b\u4e2d\u6dfb\u52a0\u4e86\u5f02\u6b65\u63a7\u5236\u7684\u90e8\u5206\uff0c\u8fd9\u90e8\u5206\u7684\u7f16\u7a0b\u53ef\u4ee5\u79f0\u4e4b\u4e3a<strong>\u5f02\u6b65\u7f16\u7a0b<\/strong>\u3002<\/p><\/blockquote>\n\n\n\n<p>\u4f7f\u7528\u5982\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\"><strong>public<\/strong> <strong>class<\/strong> <strong>StudentIDTest<\/strong> {\n  <strong>public<\/strong> <strong>static<\/strong> <strong>void<\/strong> <strong>main<\/strong>(String[] args) {\n    <em>\/\/ \u6784\u5efa\u5b66\u751f\u96c6\u5408<\/em>\n    List&lt;Student&gt; studentList = <strong>new<\/strong> ArrayList&lt;&gt;();\n    <strong>for<\/strong> (<strong>int<\/strong> i = 1; i &lt;= 10; i++) {\n      Student s = <strong>new<\/strong> Student();\n      s.setName(\"\u5b66\u751f\" + i);\n      studentList.add(s);\n    }\n\n    Register reg = <strong>new<\/strong> Register();\n\n    studentList.forEach(s -&gt; {\n      CompletableFuture.supplyAsync(\n          <em>\/\/ \u6bcf\u4e2a\u5b66\u751f\u90fd\u6ce8\u518c\u5b66\u53f7<\/em>\n          () -&gt; reg.regId(s)\n        )\n        <em>\/\/ \u5b66\u53f7\u6ce8\u518c\u5b8c\u6bd5\u540e\uff0c\u6253\u5370\u6b22\u8fce\u6d88\u606f<\/em>\n        .thenAccept(student -&gt; {\n          System.out.println(\"\u4f60\u597d \" + student.getName() + \", \u6b22\u8fce\u6765\u5230\u6625\u857e\u4e2d\u5b66\u5927\u5bb6\u5ead\");\n        });\n    });\n\n    System.out.println(\"mission complate\");\n  }\n}<\/code><\/pre>\n\n\n\n<p><code>CompletableFuture.supplyAsync()<\/code>&nbsp;\u65b9\u6cd5\u8fd0\u884c\u4e00\u4e2a\u5f02\u6b65\u4efb\u52a1\u5e76\u4e14\u8fd4\u56de\u7ed3\u679c\uff0c\u6240\u4ee5&nbsp;<code>regId()<\/code><\/p>\n\n\n\n<p><code>Register<\/code>&nbsp;\u6ca1\u6709\u5b9e\u73b0&nbsp;<code>Runnable<\/code>&nbsp;\u63a5\u53e3\uff0c\u4f46\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4f18\u5316\uff1a\u628a\u4f5c\u4e3a&nbsp;<code>supplyAsync()<\/code>&nbsp;\u65b9\u6cd5\u53c2\u6570\u7684\u6574\u4e2a&nbsp;<code>() -&gt; reg.regId(s)<\/code>&nbsp;\u8868\u8fbe\u5f0f\u8bed\u53e5\u5305\u88c5\u5728\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e2d\uff1b\u8fd9\u4e2a\u5bf9\u8c61\u4e5f\u662f JDK \u5185\u7f6e\u7684\uff0c\u5b83\u5b9e\u73b0\u4e86&nbsp;<code>Runnable<\/code><\/p>\n\n\n\n<p>\u5b9e\u9645\u4e0a <code>supplyAsync()<\/code>&nbsp;\u65b9\u6cd5\u7684\u4f5c\u7528\u662f\uff1a\u5728\u4e00\u4e2a\u5355\u72ec\u7684\u7ebf\u7a0b\u4e2d\u6267\u884c&nbsp;<code>reg.regId(s)<\/code>\u8bed\u53e5\uff0c\u672c\u8d28\u4e0a\u662f\u591a\u7ebf\u7a0b\u7f16\u7a0b<\/p>\n\n\n\n<p>\u4e4b\u540e\u4f7f\u7528 <code>thenAccept()<\/code>&nbsp;\u65b9\u6cd5\u5b8c\u6210\u540e\u7ee7\u7684\u4efb\u52a1\u6b65\u9aa4\u3002<code>thenAccept()<\/code>&nbsp;\u65b9\u6cd5\u7684\u53c2\u6570\uff08<code>student<\/code>\uff09\u5c31\u662f\u524d\u7f6e\u4efb\u52a1\u7684\u8fd4\u56de\u7ed3\u679c\uff0c\u7cfb\u7edf\u4f1a\u5728\u524d\u4e00\u4e2a\u4efb\u52a1\u5b8c\u6210\u540e\uff0c<strong>\u81ea\u52a8<\/strong>\u6267\u884c&nbsp;<code>student -&gt; {}<\/code>&nbsp;\u540e\u7ee7\u4efb\u52a1\u3002\u6240\u4ee5\u672c\u8d28\u4e0a\uff0c\u540e\u7ee7\u4efb\u52a1\u4e5f\u662f\u591a\u7ebf\u7a0b\u65b9\u5f0f\u6267\u884c\u7684\u3002<code>thenAccept()<\/code>&nbsp;\u65b9\u6cd5\u901a\u5e38\u7528\u4e8e\u4efb\u52a1\u94fe\u7684\u672b\u5c3e\u3002<\/p>\n\n\n\n<p>CompletableFuture \u4e0e \u6570\u636e\u6d41 Stream parallelStream() \u5341\u5206\u76f8\u4f3c\uff0c\u4e24\u8005\u90fd\u662f\u591a\u7ebf\u7a0b\u5e76\u53d1\u7f16\u7a0b\uff0c\u90fd\u53ef\u4ee5\u88ab\u79f0\u4e3a\u5e76\u53d1\u5bb9\u5668\uff0c\u4e0d\u540c\u7684\u662f\u524d\u8005\u4efb\u52a1\u6bd4\u8f83\u5bbd\u6cdb\uff0c\u800c\u540e\u8005\u4fa7\u91cd\u6d41\u7684\u5143\u7d20\u7684\u8ba1\u7b97\u64cd\u4f5c\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>supplyAsync()<\/code>&nbsp;\u7528\u4e8e<strong>\u5f00\u5934<\/strong>\uff0c<code>thenAccept()<\/code>&nbsp;\u7528\u4e8e<strong>\u672b\u5c3e<\/strong>\uff0c\u5404\u81ea\u8c03\u7528\u4e00\u6b21\u5373\u53ef\u3002\u4e2d\u95f4\u6709\u591a\u4e2a\u6b65\u9aa4\uff0c\u53ef\u4ee5\u8c03\u7528\u591a\u6b21&nbsp;<code>thenApply()<\/code>&nbsp;\u3002\u7531\u4e8e\u672b\u5c3e\u4e5f\u8981\u7528\u5230&nbsp;<\/p><\/blockquote>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"has-large-font-size\">\u62d3\u5c55<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>supplyAsync()<\/code>&nbsp;\u662f\u9759\u6001\u65b9\u6cd5\uff0c\u8fd4\u56de\u503c\u662f&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\u5bf9\u8c61\uff0c\u518d\u8c03\u7528&nbsp;<code>thenApply()<\/code>&nbsp;\u6216&nbsp;<code>thenAccept()<\/code>&nbsp;\u5b9e\u4f8b\u65b9\u6cd5\uff0c\u8fd4\u56de\u7684\u4e5f\u662f&nbsp;<code>CompletableFuture<\/code>\u5b9e\u4f8b\u5bf9\u8c61<\/p><\/blockquote>\n\n\n\n<p>\u6240\u4ee5\uff0c\u867d\u7136\u6574\u6761\u8bed\u53e5\u662f\u8fde\u5199\u7684\uff0c\u5176\u5b9e\u4e5f\u53ef\u4ee5\u5b9a\u4e49\u8fd4\u56de\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">CompletableFuture&lt;Void&gt; cf = CompletableFuture.supplyAsync(() -&gt; reg.regId(s))\n  .thenApply(student -&gt; {\n    <strong>return<\/strong> dis.assignClasses(student);\n  })\n  .thenAccept(student -&gt; {\n     System.out.println(\"\u59d3\u540d\uff1a\" + student.getName() + \"\uff0c\u5b66\u53f7\uff1a\" + student.getId() + \"\uff0c\u73ed\u7ea7\u53f7\uff1a\" + student.getClassId());\n  });\n<\/code><\/pre>\n\n\n\n<p>\u8fd4\u56de\u7684\u662f\u4ecd\u7136\u662f&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\u5bf9\u8c61\uff0c\u6240\u4ee5\u5b9a\u4e49\u53d8\u91cf\u7684\u7c7b\u578b\u5c31\u662f&nbsp;<code>CompletableFuture<\/code>&nbsp;\u3002\u4f46\u53ef\u4ee5\u7528\u6cdb\u578b&nbsp;<code>CompletableFuture&lt;&gt;<\/code>&nbsp;\u8868\u793a\u5176\u4e2d\u5305\u542b\u7684\u6570\u636e\u5177\u4f53\u662f\u4ec0\u4e48\u7c7b\u578b\u3002<\/p>\n\n\n\n<p>\u56e0\u4e3a\u672c\u6848\u4f8b\u672b\u5c3e\u8c03\u7528\u4e86&nbsp;<code>thenAccept()<\/code>\uff0c\u5176&nbsp;<em>Lambda<\/em>&nbsp;\u8868\u8fbe\u5f0f\u6ca1\u6709&nbsp;<code>return<\/code>&nbsp;\u8bed\u53e5\uff0c\u8868\u793a&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\u5bf9\u8c61<em><strong>\u4e0d\u5305\u542b<\/strong><\/em>\u6570\u636e\uff0c\u6240\u4ee5\u6cdb\u578b\u5199\u4e3a&nbsp;<code>CompletableFuture&lt;Void&gt;<\/code>\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><em>Void<\/em>&nbsp;\u7684\u5b8c\u6574\u5199\u6cd5\u662f&nbsp;<code>java.lang.Void<\/code>\uff0c\u662f&nbsp;<em>void<\/em>&nbsp;\u5173\u952e\u5b57\u7684\u5305\u88c5\u7c7b\u3002\u8868\u793a\u6ca1\u6709\u7c7b\u578b\uff0c\u7b49\u540c\u4e8e null<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u8fd4\u56de-completablefuture-\u7c7b\u578b\">\u8fd4\u56de CompletableFuture&nbsp;\u7c7b\u578b<\/h3>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709\u8c03\u7528&nbsp;<code>thenAccept()<\/code>&nbsp;\u65b9\u6cd5\uff0c\u4ee5&nbsp;<code>thenApply()<\/code>&nbsp;\u6216&nbsp;<code>supplyAsync()<\/code>&nbsp;\u7ed3\u5c3e\u7684\u8bdd\uff0c\u4f8b\u5982\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">CompletableFuture.supplyAsync(() -&gt; reg.regId(s))\n  .thenApply(student -&gt; {\n    <strong>return<\/strong> dis.assignClasses(student);\n  });\n<\/code><\/pre>\n\n\n\n<p>\u56e0\u4e3a&nbsp;<code>thenApply()<\/code>&nbsp;\u7684&nbsp;<em>Lambda<\/em>&nbsp;\u8868\u8fbe\u5f0f\u8fd4\u56de\u7684\u662f&nbsp;<code>Student<\/code>&nbsp;\u5bf9\u8c61\uff0c\u6240\u4ee5&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\u5bf9\u8c61\u5305\u542b\u7684\u662f&nbsp;<code>Student<\/code>&nbsp;\u6570\u636e\uff0c\u4e8e\u662f\u6cdb\u578b\u5199\u4e3a&nbsp;<code>CompletableFuture&lt;Student&gt;<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">CompletableFuture&lt;Student&gt; cf = CompletableFuture.supplyAsync(() -&gt; reg.regId(s))\n  .thenApply(student -&gt; {\n    <strong>return<\/strong> dis.assignClasses(student);\n  });\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u8fd9\u51e0\u4e2a\u65b9\u6cd5\u8fd4\u56de\u7684\u662f&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\uff0c\u4f46\u5176\u4e2d\u5305\u542b\u4ec0\u4e48\u7c7b\u578b\u7684\u6570\u636e\u53d6\u51b3\u4e8e&nbsp;<em>Lambda<\/em>&nbsp;\u8868\u8fbe\u5f0f\u8fd4\u56de\u503c\u7684\u7c7b\u578b\uff0c\u5982\u679c\u6ca1\u6709\u8fd4\u56de\u503c\uff0c\u5219\u7528&nbsp;<code>&lt;Void&gt;<\/code>&nbsp;\u8868\u793a\u3002<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3\u3001\u6269\u5c55\u77e5\u8bc6\u70b9\uff1amain-\u65b9\u6cd5\u7684\u95ee\u9898\">3\u3001\u6269\u5c55\u77e5\u8bc6\u70b9\uff1amain() \u65b9\u6cd5\u7684\u95ee\u9898<\/h2>\n\n\n\n<p>\u76ee\u524d\u6211\u4eec\u7684\u7a0b\u5e8f\uff0c\u90fd\u662f\u901a\u8fc7&nbsp;<code>main()<\/code>&nbsp;\u65b9\u6cd5\u6267\u884c\u7684\u3002\u5982\u679c\u5b66\u751f\u4eba\u6570\u8f83\u591a\uff0c\u4f8b\u5982&nbsp;<em>2000<\/em>&nbsp;\u4e2a\uff0c\u6240\u6709\u6ce8\u518c\u7ebf\u7a0b\u7684\u8fd0\u884c\u5c31\u6ca1\u6709\u90a3\u4e48\u5feb\u5b8c\u6bd5\u4e86\u3002<\/p>\n\n\n\n<p>\u95ee\u9898\u662f\uff0c\u53ef\u80fd\u7ebf\u7a0b\u4efb\u52a1\u8fd8\u6ca1\u6267\u884c\u5b8c\u6bd5\uff0c<code>main()<\/code>&nbsp;\u65b9\u6cd5\u5c31\u6267\u884c\u5b8c\u6bd5\uff0c\u5bfc\u81f4\u7a0b\u5e8f\u8fd0\u884c\u7ed3\u675f\u9000\u51fa\u4e86\u3002<\/p>\n\n\n\n<p><strong>\u770b\u5230\u8fd9\u91cc\uff0c\u5927\u5bb6\u53ef\u4ee5\u5728\u81ea\u5df1\u7535\u8111\u4e0a\u8fd0\u884c\u7a0b\u5e8f\uff0c\u6267\u884c&nbsp;<em>2000<\/em>&nbsp;\u4e2a\u751a\u81f3\u4e00\u4e07\u4e2a\u5b66\u751f\u6ce8\u518c\u3002\u89c2\u5bdf\u51fa\u73b0\u7684\u73b0\u8c61\u3002<\/strong><\/p>\n\n\n\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u8fd4\u56de\u503c\u5c31\u6709\u7528\u4e86\u3002\u6211\u4eec\u5148\u628a\u6bcf\u4e2a\u5b66\u751f\u7684\u5165\u5b66\u4efb\u52a1\u5b9e\u4f8b\u5bf9\u8c61\uff08<code>CompletableFuture&lt;Void&gt;<\/code>\uff09\uff0c\u6536\u96c6\u8d77\u6765\uff08\u88c5\u5165\u96c6\u5408\uff09\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u7684\u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">List&lt;CompletableFuture&gt; cfs = <strong>new<\/strong> ArrayList&lt;&gt;();\nstudentList.forEach(s -&gt; {\n  CompletableFuture&lt;Void&gt; cf = CompletableFuture.supplyAsync(() -&gt; reg.regId(s))\n    .thenApply(student -&gt; {\n        <strong>return<\/strong> dis.assignClasses(student);\n    }).thenAccept(student -&gt; {\n        System.out.println(\"\u59d3\u540d\uff1a\" + student.getName() + \"\uff0c\u5b66\u53f7\uff1a\" + student.getId() + \"\uff0c\u73ed\u7ea7\u53f7\uff1a\" + student.getClassId());\n    });\n\n  cfs.add(cf);\n});\n\n<strong>try<\/strong> {\n  <em>\/\/ \u7b49\u5f85\u6240\u6709\u7684\u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5<\/em>\n  CompletableFuture.allOf(cfs.toArray(<strong>new<\/strong> CompletableFuture[] {})).get();\n} <strong>catch<\/strong> (Exception e) {\n  e.printStackTrace();\n}\n<\/code><\/pre>\n\n\n\n<p><code>CompletableFuture.allOf()<\/code>&nbsp;\u662f\u9759\u6001\u65b9\u6cd5\uff0c\u7684\u4f5c\u7528\u5c31\u662f\u6536\u96c6\u6240\u6709\u7684\u4efb\u52a1\u5b9e\u4f8b\u5bf9\u8c61\u3002\u56e0\u4e3a&nbsp;<code>allOf()<\/code>&nbsp;\u65b9\u6cd5\u53ea\u652f\u6301\u6570\u7ec4\u4e0d\u652f\u6301\u96c6\u5408\uff0c\u6240\u4ee5\u9700\u8981\u628a\u96c6\u5408\u8f6c\u6362\u6210\u6570\u7ec4\uff08<code>cfs.toArray(new CompletableFuture[] {})<\/code>\uff09\u3002\u5f53\u7136\uff0c\u4f60\u53ef\u4ee5\u4e00\u5f00\u59cb\u5c31\u5b9a\u4e49\u6570\u7ec4\u6765\u6536\u96c6\u4efb\u52a1\u5b9e\u4f8b\u5bf9\u8c61\uff0c\u56e0\u4e3a\u5b66\u751f\u7684\u4e2a\u6570\u53ef\u4ee5\u901a\u8fc7&nbsp;<code>studentList.size()<\/code>&nbsp;\u53d6\u5f97\u3002<code>allOf()<\/code>&nbsp;\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u4e5f\u662f&nbsp;<code>CompletableFuture<\/code>&nbsp;\u5b9e\u4f8b\u5bf9\u8c61\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u96c6\u5408\u7684 toArray() \u65b9\u6cd5\uff0c\u5728 \u300aJava\u9762\u5411\u5bf9\u8c61\u300b\u7b2c 7 \u7ae0\u7b2c 1 \u8282\u6709\u8bb2\u5230\uff0c\u4e0d\u719f\u6089\u7684\u540c\u5b66\u53ef\u4ee5\u590d\u4e60\u4e00\u4e0b\u3002<\/p><\/blockquote>\n\n\n\n<p>\u518d\u8c03\u7528\u7c7b\u65b9\u6cd5&nbsp;<code>get()<\/code>\uff0c\u5176\u4f5c\u7528\u5c31\u662f\u7b49\u5f85\u6240\u6709\u7684\u4efb\u52a1\u7ebf\u7a0b\uff08<code>allOf()<\/code>&nbsp;\u6536\u96c6\u7684\uff09\u90fd\u6267\u884c\u5b8c\u6bd5\uff0c\u518d\u7ee7\u7eed\u6267\u884c\uff08\u672c\u6848\u4f8b&nbsp;<code>main()<\/code>&nbsp;\u65b9\u6cd5\u540e\u9762\u6ca1\u4ee3\u7801\u4e86\uff0c\u5c31\u9000\u51fa\u7a0b\u5e8f\uff09\u3002<\/p>\n\n\n\n<p>\u8fd0\u884c\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<p><em><strong>\u9700\u8981\u5f3a\u8c03\u7684\u662f<\/strong><\/em>\uff1a<\/p>\n\n\n\n<p>\u5728&nbsp;<em>SpringBoot<\/em>&nbsp;\u7b49\u670d\u52a1\u7aef\u8fd0\u884c&nbsp;<code>supplyAsync()<\/code>&nbsp;\u5f02\u6b65\u4efb\u52a1\u7f16\u6392\u7684\u65f6\u5019\uff0c\u5c31\u6ca1\u6709\u5fc5\u8981\u53ef\u4ee5\u4f7f\u7528&nbsp;<code>get()<\/code>&nbsp;\u65b9\u6cd5\u7b49\u5f85\u6240\u6709\u7ebf\u7a0b\u4efb\u52a1\u6267\u884c\u5b8c\u6bd5\u4e86\u3002\u56e0\u4e3a\u670d\u52a1\u7aef\u5f80\u5f80\u662f\u5e38\u9a7b\u7a0b\u5e8f\uff0c\u4e0d\u50cf&nbsp;<code>main()<\/code>&nbsp;\u65b9\u6cd5\u6267\u884c\u5b8c\u6bd5\u5c31\u9000\u51fa\u7a0b\u5e8f\u4e86\u3002<\/p>\n\n\n\n<div style=\"height:36px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-large-font-size\">\u5b89\u5168\u7684\u5e03\u5c14\u503c\u5305\u88c5\u7c7b<\/p>\n\n\n\n<p>Java\u9664\u4e86\u63d0\u4f9b\u80fd\u591f\u4ee5\u539f\u5b50\u7684\u65b9\u5f0f\u64cd\u4f5c\u6574\u6570\u7684 <strong>AtomicInteger<\/strong> \u4e5f\u4e3a\u5e03\u5c14\u503c\u63d0\u4f9b\u4e86\u539f\u5b50\u64cd\u4f5c\u65b9\u5f0f <strong>AtomicBoolean<\/strong> <\/p>\n\n\n\n<p><code>AtomicBoolean<\/code>&nbsp;\u662f&nbsp;<code>boolean<\/code>&nbsp;\u7684\u5305\u88c5\u7c7b\uff0c<code>AtomicBoolean<\/code>&nbsp;\u7684\u5b9e\u4f8b\u7b49\u540c\u4e8e\u4e00\u4e2a\u5e03\u5c14\u503c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>new AtomicBoolean(true)<\/code>&nbsp;\u7b49\u540c\u4e8e&nbsp;<strong>true<\/strong><\/li><li><code>new AtomicBoolean(false)<\/code>&nbsp;\u7b49\u540c\u4e8e&nbsp;<strong>false<\/strong><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u53d6\u5f97\u5e03\u5c14\u503c\">\u53d6\u5f97\u5e03\u5c14\u503c<\/h4>\n\n\n\n<p>\u5b9e\u4f8b\u5bf9\u8c61\u53d6\u5f97\u57fa\u7840\u7c7b\u578b\u7684\u5e03\u5c14\u503c\uff0c\u53ef\u4ee5\u8c03\u7528&nbsp;<code>get()<\/code>&nbsp;\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">AtomicBoolean ab = <strong>new<\/strong> AtomicBoolean(<strong>true<\/strong>);\n<strong>boolean<\/strong> value = ab.get();\n<\/code><\/pre>\n\n\n\n<p>\u5b9e\u4f8b\u5bf9\u8c61\u8c03\u7528&nbsp;<code>compareAndSet()<\/code>&nbsp;\u65b9\u6cd5\uff0c\u5c31\u80fd\u4ee5\u539f\u5b50\u7684\u65b9\u5f0f\u4fee\u6539\u503c\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"true-\u6539\u4e3a-false\">true \u6539\u4e3a false<\/h4>\n\n\n\n<p><code>compareAndSet(true, false)<\/code>&nbsp;\u5224\u65ad\u5f53\u524d\u503c\u4e3a&nbsp;<strong>true<\/strong>&nbsp;\u65f6\uff0c\u4fee\u6539\u4e3a&nbsp;<strong>false<\/strong>\uff0c\u7136\u540e\u8fd4\u56de\u6210\u529f\u6216\u5931\u8d25\u3002\u8fd9\u662f\u4e09\u4e2a\u6b65\u9aa4\u54e6\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4fee\u6539\u6210\u529f\u540e\uff0c\u65b9\u6cd5\u8fd4\u56de&nbsp;<code>true<\/code>&nbsp;\u3002<\/li><li>\u5982\u679c\u5f53\u524d\u503c\u4e0d\u662f&nbsp;<strong>true<\/strong>&nbsp;\uff0c\u5219\u4e0d\u4fee\u6539\uff0c\u8fd4\u56de\u503c\u4e3a&nbsp;<code>false<\/code>\uff0c\u8868\u793a\u64cd\u4f5c\u5931\u8d25<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>compareAndSet()<\/code>&nbsp;\u5b9e\u9645\u4e0a\u5c31\u662f\u4fdd\u8bc1\u4e86\u6574\u4e2a\u4fee\u6539\u64cd\u4f5c\u7684\u4e09\u4e2a\u6b65\u9aa4\u7684\u539f\u5b50\u6027\uff0c\u4e0d\u4f1a\u56e0\u4e3a\u591a\u7ebf\u7a0b\u51fa\u73b0\u9519\u4e71\u3002<\/p><\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"false-\u6539\u4e3a-true\">false \u6539\u4e3a true<\/h4>\n\n\n\n<p><code>compareAndSet(false, true)<\/code>&nbsp;\u5224\u65ad\u5f53\u524d\u503c\u4e3a&nbsp;<strong>false<\/strong>&nbsp;\u65f6\uff0c\u4fee\u6539\u4e3a&nbsp;<strong>true<\/strong>\uff0c\u7136\u540e\u8fd4\u56de\u6210\u529f\u6216\u5931\u8d25<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4fee\u6539\u6210\u529f\u540e\uff0c\u65b9\u6cd5\u8fd4\u56de&nbsp;<code>true<\/code>&nbsp;\u3002<\/li><li>\u5982\u679c\u5f53\u524d\u503c\u4e0d\u662f&nbsp;<strong>false<\/strong>&nbsp;\uff0c\u5219\u4e0d\u4fee\u6539\uff0c\u8fd4\u56de\u503c\u4e3a&nbsp;<code>false<\/code>\uff0c\u8868\u793a\u64cd\u4f5c\u5931\u8d25<\/li><\/ul>\n\n\n\n<p><em><strong>\u518d\u6b21\u5f3a\u8c03<\/strong><\/em>\uff1a<code>compareAndSet()<\/code>&nbsp;\u65b9\u6cd5\u8fd4\u56de\u503c\u8868\u793a<strong>\u4fee\u6539\u64cd\u4f5c<\/strong>\u6210\u529f\u6216\u5931\u8d25\uff0c\u8ddf\u65b9\u6cd5\u53c2\u6570\u503c\u65e0\u5173\u3002<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-large-font-size\">\u7ebf\u7a0b\u6c60<\/p>\n\n\n\n<p>\u4f7f\u7528<strong> Runnable <\/strong>\u63a5\u53e3\u5f00\u53d1\u591a\u7ebf\u7a0b\u7a0b\u5e8f\uff0c\u66f4\u7b26\u5408\u9762\u5411\u5bf9\u8c61\u7684\u4e60\u60ef\uff0c\u4f46\u4e5f\u4f1a\u5bfc\u81f4\u5bf9\u8c61\u592a\u591a\u7684\u95ee\u9898\uff0c\u6bd4\u5982\u5b66\u751f\u7cfb\u7edf\uff0c\u5982\u679c\u6bcf\u4e2a\u5b66\u751f\u90fd\u5206\u914d\u4e00\u4e2a\u7ebf\u7a0b\u7ebf\u7a0b\u5c31\u610f\u5473\u7740\u9700\u8981\u5206\u914d\u6570\u5343\u751a\u81f3\u8fd1\u4e07\u7684\u7ebf\u7a0b<strong>Thread<\/strong>\u5bf9\u8c61\uff0c\u6d88\u8017\u8ba1\u7b97\u673a\u8d44\u6e90\uff0c\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u590d\u7528 <strong>Thread<\/strong>\u5bf9\u8c61\u5373\u4f7f\u7528\u7ebf\u7a0b\u6c60<\/p>\n\n\n\n<p>\u7ebf\u7a0b\u6c60\u5c31\u50cf\u4e00\u4e2a\u6c60\u5b50\uff0c\u88c5\u6ee1\u4e86\u7ebf\u7a0b\uff0c\u968f\u7528\u968f\u53d6\uff0c\u7ebf\u7a0b\u53ef\u4ee5\u88ab\u590d\u7528\uff0c\u4e00\u4e2a\u7ebf\u7a0b\u53ef\u4ee5\u6267\u884cA\u4efb\u52a1\uff0c\u4e5f\u53ef\u4ee5\u6267\u884cB\u4efb\u52a1\uff0c\u4e8e\u662f\u7ebf\u7a0b\u4e0d\u518d\u9891\u7e41\u521b\u5efa\u548c\u9500\u6bc1\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>new Thread(register)<\/code>&nbsp;\u610f\u5473\u7740\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u8c61\u53ea\u80fd\u6267\u884c\u4e00\u4e2a\u4efb\u52a1\uff0c\u800c\u7ebf\u7a0b\u6c60\u8ba9\u7ebf\u7a0b\u4e0e\u4efb\u52a1\u5206\u79bb\uff0c\u4e0d\u518d\u7d27\u5bc6\u7ed1\u5b9a<\/p><\/blockquote>\n\n\n\n<p>\u540c\u65f6\u7ebf\u7a0b\u6c60\u4e0d\u662f\u65e0\u9650\u5927\u7684\uff0c\u91cc\u9762\u5b58\u5728\u7684\u7ebf\u7a0b\u6570\u4e5f\u662f\u6709\u9650\u7684\uff0c\u8fd9\u610f\u5473\u7740\u80fd\u540c\u65f6\u8fd0\u884c\u7684\u4efb\u52a1\u6570\u662f\u6709\u9650\u7684\uff0c\u5176\u4ed6\u8fc7\u5269\u7684\u4efb\u52a1\u5c31\u9700\u8981\u6392\u961f\uff0c\u7b49\u5f85\u6709\u7a7a\u95f2\u7684\u7ebf\u7a0b\u518d\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u6838\u5fc3\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\"><strong>public<\/strong> <strong>class<\/strong> <strong>StudentIDTest<\/strong> {\n\n  <em>\/\/ \u7ebf\u7a0b\u5de5\u5382<\/em>\n  <strong>private<\/strong> <strong>static<\/strong> <strong>final<\/strong> ThreadFactory namedThreadFactory = <strong>new<\/strong> BasicThreadFactory.Builder()\n    .namingPattern(\"studentReg-pool-%d\")\n    .daemon(<strong>true<\/strong>)\n    .build();\n\n  <em>\/\/ \u7b49\u5f85\u961f\u5217<\/em>\n  <strong>private<\/strong> <strong>static<\/strong> <strong>final<\/strong> BlockingQueue&lt;Runnable&gt; workQueue = <strong>new<\/strong> LinkedBlockingQueue&lt;Runnable&gt;(1024);\n\n  <em>\/\/ \u7ebf\u7a0b\u6c60\u670d\u52a1<\/em>\n  <strong>private<\/strong> <strong>static<\/strong> <strong>final<\/strong> ThreadPoolExecutor EXECUTOR_SERVICE = <strong>new<\/strong> ThreadPoolExecutor(\n        20,\n        200,\n        30,\n        TimeUnit.SECONDS,\n        workQueue,\n        namedThreadFactory,\n        <strong>new<\/strong> ThreadPoolExecutor.AbortPolicy()\n      );\n\n  <strong>public<\/strong> <strong>static<\/strong> <strong>void<\/strong> <strong>main<\/strong>(String[] args) {\n\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u7684 <strong>BasicThreadFactory<\/strong> \u9700\u8981\u4e00\u4e2a\u4f9d\u8d56\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\">&lt;dependency&gt;\n  &lt;groupId&gt;org.apache.commons&lt;\/groupId&gt;\n  &lt;artifactId&gt;commons-lang3&lt;\/artifactId&gt;\n  &lt;version&gt;3.10&lt;\/version&gt;\n&lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<div style=\"height:18px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>1.\u521b\u5efa\u7ebf\u7a0b\u5de5\u5382\u5b9e\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\"><strong>new<\/strong> BasicThreadFactory.Builder()\n  .namingPattern(\"studentReg-pool-%d\")\n  .daemon(<strong>true<\/strong>)\n  .build();<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u7684<strong>namingPattern()<\/strong>\u5b9a\u4e49\u4e86\u7ebf\u7a0b\u540d\u79f0\u7684\u683c\u5f0f\uff0c\u5373\u7ebf\u7a0b\u540d\u79f0\u6a21\u677f<\/p>\n\n\n\n<div style=\"height:6px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>2.\u521b\u5efa\u7ebf\u7a0b\u7b49\u5f85\u961f\u5217\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n<p>\u7ebf\u7a0b\u6c60\u6ca1\u6709\u7a7a\u95f2\u7684\u7ebf\u7a0b\u65f6\uff0c\u5176\u5b83\u7684\u4efb\u52a1\uff0c\u5c31\u9700\u8981\u5728\u961f\u5217\u4e2d\u7b49\u5f85\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u53ef\u4ee5\u7c7b\u6bd4\u4e00\u4e0b\uff1a\u6625\u8fd0\u671f\u95f4\u5750\u706b\u8f66\u7684\u4eba\u592a\u591a\uff0c\u706b\u8f66\u7ad9\u5019\u8f66\u5927\u5385\u5bb9\u91cf\u6709\u9650\uff0c\u5f88\u591a\u4e58\u5ba2\u5c31\u5728\u5019\u8f66\u5927\u5385\u5916\u6392\u961f\u7b49\u5019\u3002<\/p><\/blockquote>\n\n\n\n<p>\u5982\u679c\u673a\u5668\u6027\u80fd\u597d\uff0cCPU \u6838\u6570\u591a\uff086\u30018\u6838\uff09\u3001\u5185\u5b58\u5927\uff0c\u961f\u5217\u53ef\u4ee5\u5927\u4e00\u4e9b\uff1a<code>new LinkedBlockingQueue&lt;Runnable&gt;(2048)<\/code>\u3002\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u8868\u793a\u80fd\u6392\u961f\u7684\u4efb\u52a1\u4e2a\u6570\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u673a\u5668\u6027\u80fd\u597d\uff0cCPU \u6838\u6570\u5c11\uff081\u30012\u6838\uff09\u3001\u5185\u5b58\u5927\uff0c\u961f\u5217\u5c31\u5c0f\u4e00\u4e9b\uff1a<code>new LinkedBlockingQueue&lt;Runnable&gt;(512)<\/code><\/p>\n\n\n\n<p>\u4e00\u822c\u6765\u8bf4\uff0c<code>new LinkedBlockingQueue&lt;Runnable&gt;(1024)<\/code>\u4e5f\u8fd8\u53ef\u4ee5<\/p>\n\n\n\n<div style=\"height:6px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>3.\u521b\u5efa\u7ebf\u7a0b\u6c60\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n<p><code>ThreadPoolExecutor<\/code>&nbsp;\u6784\u9020\u51fd\u6570\u53c2\u6570\u8f83\u591a\uff0c\u4e03\u4e2a\u53c2\u6570\u6309\u987a\u5e8f\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u53c2\u6570\u5e8f\u53f7<\/th><th>\u89e3\u91ca<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>\u7ebf\u7a0b\u6c60\u521d\u59cb\u5316\u6838\u5fc3\u7ebf\u7a0b\u6570\u91cf\uff0c\u4e00\u822c\u662f\u4e24\u4f4d\u6570\uff0c\u901a\u5e38\u4e0d\u5927<\/td><\/tr><tr><td>2<\/td><td>\u7ebf\u7a0b\u6c60\u6700\u5927\u7ebf\u7a0b\u6570\uff0c\u8ba1\u7b97\u673a\u6027\u80fd\u5f3a\u5c31\u5927\u4e00\u4e9b\uff0c\u5426\u5219\u5c0f\u4e00\u4e9b\uff0c\u901a\u5e38\u4e0d\u8d85\u8fc7 200<\/td><\/tr><tr><td>3<\/td><td>\u7ebf\u7a0b\u6c60\u4e2d\u7684\u7ebf\u7a0b\u6570\u8d85\u8fc7\u6838\u5fc3\u7ebf\u7a0b\u6570\u65f6\uff0c\u5982\u679c\u4e00\u6bb5\u65f6\u95f4\u540e\u8fd8\u6ca1\u6709\u4efb\u52a1\u6307\u6d3e\uff0c\u5c31\u56de\u6536\u4e86\u3002\u60f3\u7acb\u5373\u56de\u6536\u5c31\u586b 0\uff0c\u4e00\u822c 30<\/td><\/tr><tr><td>4<\/td><td>\u7b2c\u4e09\u4e2a\u53c2\u6570\u7684\u65f6\u95f4\u5355\u4f4d\u300230 + TimeUnit.SECONDS \u8868\u793a 30 \u79d2<\/td><\/tr><tr><td>5<\/td><td>\u7b49\u5f85\u961f\u5217\u5b9e\u4f8b\uff0c\u5df2\u7ecf\u521b\u5efa\u8fc7\u4e86<\/td><\/tr><tr><td>6<\/td><td>\u7ebf\u7a0b\u5de5\u5382\u5b9e\u4f8b\uff0c\u5df2\u7ecf\u521b\u5efa\u8fc7\u4e86<\/td><\/tr><tr><td>7<\/td><td>\u4efb\u52a1\u592a\u591a\uff0c\u8d85\u8fc7\u961f\u5217\u7684\u5bb9\u91cf\u65f6\uff0c\u7528\u4ec0\u4e48\u6837\u7684\u7b56\u7565\u5904\u7406\u3002\u4e00\u822c\u7528 AbortPolicy \u8868\u793a\u62d2\u7edd\uff0c\u8ba9\u4e3b\u7a0b\u5e8f\u81ea\u5df1\u5904\u7406<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u591a\u7ebf\u7a0b\u7f16\u7a0b<strong>\u7279\u522b\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898<\/strong>\u7684\u662f\uff1a\u9632\u6b62\u7ebf\u7a0b\u6570\u8fc7\u591a\u628a\u7cfb\u7edf\u641e\u5d29\u6e83\u3002\u6240\u4ee5\u7528\u7ebf\u7a0b\u6c60\u53ef\u4ee5\u505a\u66f4\u52a0\u7cbe\u786e\u7684\u63a7\u5236\uff0c\u5426\u5219\u96be\u4ee5\u63a7\u5236\u3001\u65e0\u6cd5\u4fdd\u8bc1\u7a33\u5b9a\u3002<\/p>\n\n\n\n<p>\u5b9e\u9645\u7f16\u7a0b\u5de5\u4f5c\u4e2d\uff0c\u8981\u60f3\u529e\u6cd5\u4fdd\u8bc1\u4e0d\u8981\u521b\u5efa\u592a\u591a\u7684\u4efb\u52a1\uff0c\u8981\u6709\u6240\u63a7\u5236\uff0c\u800c\u4e0d\u662f\u53ea\u7ba1\u521b\u5efa\u4efb\u52a1\u6254\u8fdb\u7ebf\u7a0b\u6c60\u3002\u6bd4\u5982\u53ef\u4ee5\u91c7\u7528\u5206\u9875\u7684\u601d\u60f3\uff0c<strong>\u5206\u6279\u5904\u7406<\/strong>\u3002\u4e00\u6279\u53ea\u5904\u7406\u51e0\u5341\u4e2a\u3001\u4e00\u4e8c\u767e\u4e2a\u4efb\u52a1\u3002\u8fd8\u8981\u8003\u8651\u4efb\u52a1\u6267\u884c\u65f6\u95f4\uff0c\u80fd\u4e0d\u80fd\u5feb\u901f\u7ed3\u675f\u3002\u4e0d\u8981\u8ba9\u4e00\u53f0\u8ba1\u7b97\u673a\u5806\u79ef\u592a\u591a\u4efb\u52a1\uff0c\u4fdd\u8bc1\u7ebf\u7a0b\u7b49\u5f85\u961f\u5217\u80fd\u5bb9\u7eb3\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e9b\u5bb9\u91cf\u5927\u5c0f\u7684\u5404\u4e2a\u53c2\u6570\u503c\uff0c\u5728\u5b66\u4e60\u9636\u6bb5\uff0c\u90fd\u4e0d\u7528\u7ea0\u7ed3\u3002\u4f8b\u5b50\u4e2d\u7684\u591f\u7528\u4e86\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u5b9e\u9645\u5de5\u4f5c\u4e2d\uff0c\u6839\u636e\u516c\u53f8\u7684\u670d\u52a1\u5668\u7684\u72b6\u51b5\uff0c\u9009\u62e9\u5408\u9002\u7684\u6570\u503c\uff0c\u5230\u65f6\u5019\u8ddf\u516c\u53f8\u7ecf\u9a8c\u4e30\u5bcc\u7684\u540c\u4e8b\u8bf7\u6559\u3001\u6c9f\u901a\u5373\u53ef\u3002<\/p><\/blockquote>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u4f60\u7684\u7ebf\u7a0b\u9700\u8981\u6267\u884c\u4e00\u4e2a\u540e\u7ee7\u4efb\u52a1\uff0c\u5373\u5b8c\u6210\u6bcf\u4e2a\u524d\u7f6e\u4efb\u52a1\u540e\uff0c\u4f1a\u81ea\u52a8\u6267\u884c\u4e0b\u4e00\u4e2a\u4efb\u52a1\u3002\u8fd9\u65f6\u6211\u4eec\u4f7f\u7528Completable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-1025","post","type-post","status-publish","format-standard","hentry","category-6"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/1025"}],"collection":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/comments?post=1025"}],"version-history":[{"count":9,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/1025\/revisions"}],"predecessor-version":[{"id":1060,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/posts\/1025\/revisions\/1060"}],"wp:attachment":[{"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/media?parent=1025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/categories?post=1025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fireinsect.top\/index.php\/wp-json\/wp\/v2\/tags?post=1025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}