{"id":2128,"date":"2020-07-01T08:20:52","date_gmt":"2020-07-01T00:20:52","guid":{"rendered":"https:\/\/coderbee.net\/?p=2128"},"modified":"2020-07-01T08:26:30","modified_gmt":"2020-07-01T00:26:30","slug":"ratelimiter-%e6%b5%85%e6%9e%90","status":"publish","type":"post","link":"https:\/\/coderbee.net\/index.php\/open-source\/20200701\/2128","title":{"rendered":"RateLimiter \u6d45\u6790"},"content":{"rendered":"<p>\u672c\u6587\u57fa\u4e8e Guava-18.0.jar \u3002<\/p>\n<h1>0. \u6982\u8ff0<\/h1>\n<p><code>RateLimiter<\/code> \u662f\u4ee4\u724c\u6876\u601d\u60f3\u7684\u4e00\u4e2a\u5b9e\u73b0\uff0c\u53ef\u5b9e\u73b0\u6d41\u91cf\u6574\u5f62\u3001\u8d44\u6e90\u8bbf\u95ee\u901f\u7387\u63a7\u5236\u3002<\/p>\n<p>\u4e0e\u4fe1\u53f7\u91cf\u5bf9\u6bd4\uff1a<\/p>\n<ul>\n<li>\u4e00\u65e6\u4ece <code>RateLimiter<\/code> \u83b7\u5f97\u8bb8\u53ef\uff0c\u4e0d\u9700\u8981\u91ca\u653e\u3002\u4fe1\u53f7\u91cf\u5206\u914d\u540e\u5fc5\u987b\u91ca\u653e\u3002<\/li>\n<li><code>RateLimiter<\/code> \u63a7\u5236\u7684\u662f\u901f\u7387\uff0c\u4ee5\u914d\u7f6e\u7684\u901f\u7387\u5206\u53d1\u8bb8\u53ef\uff0c\u901f\u7387\u4e0d\u53d8\u65f6\u5355\u4f4d\u65f6\u95f4\u5185\u5206\u53d1\u7684\u8bb8\u53ef\u91cf\u662f\u6052\u5b9a\u7684\u3002\u4fe1\u53f7\u91cf\u63a7\u5236\u7684\u662f\u5e76\u53d1\u8bbf\u95ee\u7684\u6570\u91cf\uff0c\u5355\u4f4d\u65f6\u95f4\u5185\u5206\u914d\u7684\u6b21\u6570\u8ddf\u4f7f\u7528\u8bb8\u53ef\u7684\u65f6\u957f\u6709\u5173\uff0c\u6bcf\u6b21\u7533\u8bf7\u4f7f\u7528\u7684\u65f6\u95f4\u8d8a\u77ed\uff0c\u5219\u5355\u4f4d\u65f6\u95f4\u5185\u80fd\u5206\u914d\u7684\u6b21\u6570\u5c31\u8d8a\u591a\u3002<\/li>\n<\/ul>\n<p>\u5bf9 <code>RateLimiter<\/code> \u8bf7\u6c42\u8bb8\u53ef\u7684\u6570\u91cf\u4e0d\u4f1a\u5bf9\u8bf7\u6c42\u672c\u8eab\u4ea7\u751f\u6291\u5236\u5f71\u54cd\uff0c\u4f46\u4f1a\u5bf9\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4ea7\u751f\u6291\u5236\u3002\u4f8b\u5982\u4e00\u4e2a\u8bf7\u6c42\u5f88\u5927\u6570\u91cf\u8bb8\u53ef\u7684\u8bf7\u6c42\u5230\u8fbe\u7a7a\u95f2 <code>RateLimiter<\/code> \u65f6\uff0c\u5b83\u5c06\u9a6c\u4e0a\u83b7\u5f97\u8bb8\u53ef\uff0c\u4f46\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4f1a\u88ab\u6291\u5236\uff0c\u4ece\u800c\u4e3a\u524d\u9762\u6602\u8d35\u7684\u8bf7\u6c42\u4ed8\u51fa\u4ee3\u4ef7\u3002<\/p>\n<p>\u4ece <code>RateLimiter<\/code> \u7533\u8bf7\u8bb8\u53ef\u65f6\uff0c\u53ef\u80fd\u4f1a\u963b\u585e\u3001\u4e5f\u53ef\u80fd\u4e0d\u4f1a\uff0c\u662f\u5426\u963b\u585e\u53d6\u51b3\u4e8e\u4e0a\u4e00\u6b21\u5206\u914d\u8bb8\u53ef\u7684\u65f6\u95f4\u548c\u5f53\u524d\u8bf7\u6c42\u7684\u8bb8\u53ef\u6570\u91cf\u3002<\/p>\n<p><code>RateLimiter<\/code> \u53ef\u4ee5\u914d\u7f6e\u4e00\u4e2a warnup \u70ed\u8eab\u5468\u671f\uff0c\u5728\u8fd9\u4e2a\u5468\u671f\u5185\u6bcf\u79d2\u53d1\u51fa\u7684\u8bb8\u53ef\u6570\u91cf\u7a33\u6b65\u589e\u957f\u76f4\u81f3\u8fbe\u5230\u7a33\u5b9a\u7684\u901f\u7387\u3002\u7b80\u5355\u8bf4\u662f\u6162\u542f\u52a8\u5427\u3002<\/p>\n<h1>1. \u4f7f\u7528\u793a\u4f8b\uff1a<\/h1>\n<pre><code class=\"java\">\/\/ \u6bcf\u79d22\u4e2a\u7684\u901f\u7387\u63d0\u4ea4\u4efb\u52a1\nfinal RateLimiter rateLimiter = RateLimiter.create(2.0);\nvoid submitTasks(List tasks, Executor executor) {\n    for (Runnable task : tasks) {\n        rateLimiter.acquire(); \/\/ may wait\n        executor.execute(task);\n    }\n}\n<\/code><\/pre>\n<p><!--more--><\/p>\n<h1>2. \u6d45\u6790<\/h1>\n<h2>2.0 \u7ee7\u627f\u5173\u7cfb<\/h2>\n<pre><code>RateLimiter\n    -- SmoothRateLimiter\n        -- SmoothBursty\n        -- SmoothWarmingUp\n<\/code><\/pre>\n<h2>2.1 \u521b\u5efa<\/h2>\n<p><code>RateLimiter<\/code> \u662f\u4e2a\u62bd\u8c61\u7c7b\uff0c\u63d0\u4f9b\u9759\u6001\u65b9\u6cd5\u6765\u521b\u5efa\u5177\u4f53\u7684\u5b50\u7c7b\u5b9e\u4f8b\u3002<\/p>\n<p>\u6bcf\u4e2a\u5b9e\u4f8b\u6301\u6709\u4e00\u4e2a <code>SleepingStopwatch<\/code> \u5b9e\u4f8b\uff0c\u7528\u6765\u8ba1\u65f6\u3001\u63d0\u4f9b\u7761\u7720\u7b49\u5f85\u7684\u529f\u80fd\u3002<\/p>\n<p><code>RateLimiter<\/code> \u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u901a\u8fc7 <code>synchronized<\/code> \u5173\u952e\u5b57\u6765\u4fdd\u8bc1\u3002<\/p>\n<pre><code class=\"java\">public abstract class RateLimiter {\n  public static RateLimiter create(double permitsPerSecond) {\n    return create(SleepingStopwatch.createFromSystemTimer(), permitsPerSecond);\n  }\n\n  static RateLimiter create(SleepingStopwatch stopwatch, double permitsPerSecond) {\n    RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 \/* maxBurstSeconds *\/);\n    rateLimiter.setRate(permitsPerSecond);\n    return rateLimiter;\n  }\n\n  public static RateLimiter create(double permitsPerSecond, long warmupPeriod, TimeUnit unit) {\n    checkArgument(warmupPeriod &gt;= 0, \"warmupPeriod must not be negative: %s\", warmupPeriod);\n    return create(SleepingStopwatch.createFromSystemTimer(), permitsPerSecond, warmupPeriod, unit);\n  }\n\n  static RateLimiter create(\n      SleepingStopwatch stopwatch, double permitsPerSecond, long warmupPeriod, TimeUnit unit) {\n    RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit);\n    rateLimiter.setRate(permitsPerSecond);\n    return rateLimiter;\n  }\n\n  private final SleepingStopwatch stopwatch;\n\n  \/\/ \u7528\u6765\u63d0\u4f9b\u76d1\u89c6\u5668\u9501\u7684\u5bf9\u8c61\n  private volatile Object mutexDoNotUseDirectly;\n}\n<\/code><\/pre>\n<h2>2.2 \u7ebf\u7a0b\u5b89\u5168\u6027\u4e0e\u7b49\u5f85<\/h2>\n<pre><code class=\"java\">  public double acquire(int permits) {\n    \/\/ \u7533\u8bf7\u7ed9\u5b9a\u6570\u91cf\u7684\u8bb8\u53ef\uff0c\u8fd4\u56de\u6210\u529f\u83b7\u5f97\u8bb8\u53ef\u9700\u8981\u7b49\u5f85\u7684\u65f6\u95f4\u3002\n    long microsToWait = reserve(permits);\n\n    \/\/ \u8fdb\u884c\u7b49\u5f85\n    stopwatch.sleepMicrosUninterruptibly(microsToWait);\n    return 1.0 * microsToWait \/ SECONDS.toMicros(1L);\n  }\n\n  final long reserve(int permits) {\n    checkPermits(permits);\n\n    \/\/ \u5229\u7528\u76d1\u89c6\u5668\u9501\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\u6027\n    synchronized (mutex()) {\n      return reserveAndGetWaitLength(permits, stopwatch.readMicros());\n    }\n  }\n\n  final long reserveAndGetWaitLength(int permits, long nowMicros) {\n    \/\/ \u8fd4\u56de\u53ef\u83b7\u5f97\u8bb8\u53ef\u7684\u65f6\u523b\n    long momentAvailable = reserveEarliestAvailable(permits, nowMicros);\n\n    \/\/ \u4e0e\u5f53\u524d\u65f6\u95f4\u505a\u5dee\u624d\u662f\u8981\u7b49\u5f85\u7684\u65f6\u957f\n    return max(momentAvailable - nowMicros, 0);\n  }\n\n  \/\/ \u5177\u4f53\u7684\u5206\u914d\u8bb8\u53ef\u7684\u884c\u4e3a\u7531\u5b50\u7c7b\u5b9e\u73b0\uff0c\u5728 SmoothRateLimiter \u7c7b\u91cc\n  abstract long reserveEarliestAvailable(int permits, long nowMicros);\n<\/code><\/pre>\n<h2>2.3 \u4ee4\u724c\u5206\u914d\u6838\u5fc3\u7b97\u6cd5<\/h2>\n<p>\u4e0b\u9762\u7684\u4ee3\u7801\u4f4d\u4e8e <code>SmoothRateLimiter<\/code> \u7c7b\u91cc\u3002<\/p>\n<p>\u5c5e\u6027\uff1a<\/p>\n<pre><code class=\"java\">\/\/ \u5f53\u524d\u5df2\u5b58\u50a8\u7684\u8bb8\u53ef\uff0c\u4ee4\u724c\u6876\u6876\u91cc\u6512\u7684\ndouble storedPermits;\n\n\/\/ \u4ee4\u724c\u6876\u80fd\u5bb9\u7eb3\u7684\u6700\u5927\u8bb8\u53ef\u6570\u91cf\ndouble maxPermits;\n\n\/\/ \u7a33\u5b9a\u901f\u7387\u4e0b\u3001\u751f\u6210\u4e24\u4e2a\u8bb8\u53ef\u4e4b\u95f4\u7684\u65f6\u95f4\u95f4\u9694\u3002\n\/\/ \u4f8b\u5982\u7a33\u5b9a\u901f\u7387\u662f\u6bcf\u79d2 5 \u4e2a\u8bb8\u53ef\uff0c\u90a3\u4e48\u7a33\u5b9a\u7684\u95f4\u9694\u662f 200ms\ndouble stableIntervalMicros;\n\n\/\/ \u4e0b\u4e00\u6b21\u8bf7\u6c42\uff08\u4e0d\u7ba1\u7533\u8bf7\u7684\u5927\u5c0f\uff09\u88ab\u6388\u4e88\u7684\u65f6\u95f4\u3002\n\/\/ \u5728\u6388\u6743\u4e00\u4e2a\u8bf7\u6c42\u540e\uff0c\u4f1a\u628a\u8fd9\u4e2a\u503c\u63a8\u5411\u66f4\u8fdc\u7684\u672a\u6765\u3002\u66f4\u5927\u7684\u8bf7\u6c42\u6bd4\u5c0f\u7684\u8bf7\u6c42 \u63a8\u7684\u66f4\u8fdc\u3002\n\/\/ \u6b64\u503c\u53ef\u80fd\u5728\u8fc7\u53bb\u6216\u672a\u6765\nprivate long nextFreeTicketMicros = 0L;\n<\/code><\/pre>\n<p>\u4ee4\u724c\u5206\u914d\u6838\u5fc3\u7b97\u6cd5\uff1a<\/p>\n<pre><code class=\"java\">  final long reserveEarliestAvailable(int requiredPermits, long nowMicros) {\n    \/\/ \u540c\u6b65\u65f6\u95f4\u548c\u6876\u91cc\u7684\u4ee4\u724c\u6570\u91cf\n    resync(nowMicros);\n\n    \/\/ \u5f53\u524d\u8bf7\u6c42\u83b7\u53d6\u6210\u529f\u7684\u65f6\u95f4\u4e3a nextFreeTicketMicros\n    \/\/ \u4e0e\u8bf7\u6c42\u6570\u91cf requiredPermits \u65e0\u5173\n    long returnValue = nextFreeTicketMicros;\n\n    \/\/ \u8ba1\u7b97\u5f53\u524d\u7acb\u5373\u53ef\u5f97\u7684\u8bb8\u53ef\u6570\u91cf\n    double storedPermitsToSpend = min(requiredPermits, this.storedPermits);\n\n    \/\/ \u5f53\u524d\u8bf7\u6c42\u9700\u8981\u65b0\u751f\u6210\u7684\u8bb8\u53ef\u6570\u91cf\n    double freshPermits = requiredPermits - storedPermitsToSpend;\n\n    \/\/ \u751f\u6210\u4e0a\u8ff0\u6570\u91cf\u65b0\u8bb8\u53ef\u9700\u8981\u7684\u65f6\u95f4\n    long waitMicros = storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend)\n        + (long) (freshPermits * stableIntervalMicros);\n\n    \/\/ \u65b0\u8bb8\u53ef\u9700\u8981\u7684\u65f6\u95f4\u7531\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u627f\u62c5\n    this.nextFreeTicketMicros = nextFreeTicketMicros + waitMicros;\n\n    this.storedPermits -= storedPermitsToSpend;\n    return returnValue;\n  }\n\n  private void resync(long nowMicros) {\n    \/\/ nextFreeTicket \u5904\u4e8e\u8fc7\u53bb\uff0c\u8bf4\u660e\u5f53\u524d\u8bf7\u6c42\u53ef\u4ee5\u7acb\u5373\u7533\u8bf7\u6210\u529f\n    if (nowMicros &gt; nextFreeTicketMicros) {\n      \/\/ \u66f4\u65b0\u6876\u91cc\u7684\u4ee4\u724c\u6570\u91cf\u3001\u4f46\u4e0d\u80fd\u8d85\u8fc7\u6876\u7684\u5bb9\u91cf\n      storedPermits = min(maxPermits,\n          storedPermits + (nowMicros - nextFreeTicketMicros) \/ stableIntervalMicros);\n      nextFreeTicketMicros = nowMicros;\n    }\n  }\n<\/code><\/pre>\n<p>\u8be5\u7b97\u6cd5\u7684\u6838\u5fc3\u903b\u8f91\u4e3a\uff1a<\/p>\n<ol>\n<li>\u5982\u679c <code>nextFreeTicketMicros<\/code> \u5904\u4e8e\u8fc7\u53bb\uff0c\u5f53\u524d\u8bf7\u6c42\u53ef\u4ee5\u7acb\u5373\u6210\u529f\uff0c\u4e0d\u7ba1\u5b83\u7533\u8bf7\u7684\u8bb8\u53ef\u6570\u91cf\u662f\u591a\u5c11\u3002<\/li>\n<li>\u5982\u679c <code>nextFreeTicketMicros<\/code> \u5904\u4e8e\u672a\u6765\uff0c\u8bf4\u660e\u5f53\u524d\u8bf7\u6c42\u53d7\u524d\u9762\u8bf7\u6c42\u7684\u5f71\u54cd\uff0c\u9700\u8981\u7b49\u5f85 <code>(nowMicros - nextFreeTicketMicros)<\/code>\u3002<\/li>\n<li>\u8981\u7b49\u5f85\u7684\u8bb8\u53ef\u6570\u91cf\u4e3a <code>freshPermits = requiredPermits - min(requiredPermits, this.storedPermits)<\/code>\u3002<\/li>\n<li>\u8981\u7b49\u5f85\u7684\u65f6\u95f4\u4e3a <code>waitMicros = X + (long) (freshPermits * stableIntervalMicros)<\/code>\uff0c\u8fd9\u4e2a\u7b49\u5f85\u65f6\u95f4\u7531\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u627f\u53d7\u3002\u5176\u4e2d <code>X = storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend)<\/code> \u7531\u5b50\u7c7b\u7684\u5177\u4f53\u5b9e\u73b0\u51b3\u5b9a\uff0c<code>SmoothWarmingUp<\/code> \u5b50\u7c7b\u7528\u8be5\u65b9\u6cd5\u5b9e\u73b0\u6162\u542f\u52a8\u3002<\/li>\n<li>\u66f4\u65b0\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u7acb\u5373\u6210\u529f\u7684\u65f6\u95f4\uff1a<code>this.nextFreeTicketMicros = nextFreeTicketMicros + waitMicros<\/code> \u3002<\/li>\n<\/ol>\n<p>\u4e0a\u9762\u7684\u903b\u8f91\u8d2f\u5f7b\u4e86\u524d\u9762\u6240\u8bf4\u7684\uff1a<\/p>\n<blockquote><p>\n  \u5bf9 <code>RateLimiter<\/code> \u8bf7\u6c42\u8bb8\u53ef\u7684\u6570\u91cf\u4e0d\u4f1a\u5bf9\u8bf7\u6c42\u672c\u8eab\u4ea7\u751f\u6291\u5236\u5f71\u54cd\uff0c\u4f46\u4f1a\u5bf9\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4ea7\u751f\u6291\u5236\u3002\u4f8b\u5982\u4e00\u4e2a\u8bf7\u6c42\u5f88\u5927\u6570\u91cf\u8bb8\u53ef\u7684\u8bf7\u6c42\u5230\u8fbe\u7a7a\u95f2 <code>RateLimiter<\/code> \u65f6\uff0c\u5b83\u5c06\u9a6c\u4e0a\u83b7\u5f97\u8bb8\u53ef\uff0c\u4f46\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4f1a\u88ab\u6291\u5236\uff0c\u4ece\u800c\u4e3a\u524d\u9762\u6602\u8d35\u7684\u8bf7\u6c42\u4ed8\u51fa\u4ee3\u4ef7\u3002\n<\/p><\/blockquote>\n<h1>3. \u5c0f\u7ed3<\/h1>\n<p><code>RateLimiter<\/code> \u7684\u6838\u5fc3\u601d\u8def\u662f\u4f18\u5148\u6ee1\u8db3\u5f53\u524d\u8bf7\u6c42\u3002<\/p>\n<p>\u5982\u679c\u6876\u91cc\u7684\u4ee4\u724c\u6570\u91cf\u4e0d\u80fd\u6ee1\u8db3\u5f53\u524d\u8bf7\u6c42\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u901f\u7387\u8981\u6c42\uff0c\u53ef\u4ee5\u8ba9\u5f53\u524d\u8bf7\u6c42\u7b49\u5f85\u4ee4\u724c\u751f\u6210\uff0c\u4e5f\u5c31\u662f\u8ba9\u5f53\u524d\u8bf7\u6c42\u7b49\u5f85\uff0c\u4e5f\u53ef\u4ee5\u8ba9\u540e\u9762\u7684\u8bf7\u6c42\u5ef6\u8fdf\u6267\u884c\u3002<\/p>\n<p>\u4e0d\u7ba1\u662f\u8ba9\u8c01\u7b49\u90fd\u53ef\u80fd\u8981\u7b49\u5f85\uff0c\u90a3\u4e0d\u5982\u8ba9\u5f53\u524d\u7684\u8bf7\u6c42\u4f18\u5148\u6ee1\u8db3\u3001\u540e\u9762\u7684\u8bf7\u6c42\u53bb\u7b49\u5f85\u3002\u5982\u679c\u540e\u9762\u7684\u8bf7\u6c42\u6765\u5f97\u5f88\u665a\u6216\u8005\u6839\u672c\u5c31\u4e0d\u6765\uff0c\u90a3\u5c31\u4e0d\u9700\u8981\u7b49\u5f85\u3001\u8d5a\u5230\u4e86\u3002<\/p>\n<p>\u4e0e\u6f0f\u6876\u7b97\u6cd5\u7684\u5bf9\u6bd4\uff1a<\/p>\n<ul>\n<li>\u4ece\u4e0a\u9762\u7684\u5b9e\u73b0\u53ef\u77e5\uff0c\u4ee4\u724c\u6876\u662f\u5141\u8bb8\u7a81\u53d1\u6d41\u91cf\u7684\uff0c\u8fd9\u4e2a\u7a81\u53d1\u7684\u5cf0\u503c\u8fd8\u4e0d\u53d7\u6876\u5bb9\u91cf\u7684\u9650\u5236\u3002<\/li>\n<li>\u6f0f\u6876\u7b97\u6cd5\u7684\u6d41\u51fa\u901f\u7387\u662f\u6052\u5b9a\u7684\uff0c\u4e0d\u5b58\u5728\u7a81\u53d1\u6d41\u91cf\u7684\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u5fae\u4fe1\u516c\u4f17\u53f7: <strong>coderbee\u7b14\u8bb0<\/strong> \u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"258\" height=\"258\" src=\"https:\/\/coderbee.net\/wp-content\/uploads\/2019\/01\/coderbee-note.jpg\" class=\"alignnone size-full wp-image-1707\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u57fa\u4e8e Guava-18.0.jar \u3002 0. \u6982\u8ff0 RateLimiter  &hellip; <a href=\"https:\/\/coderbee.net\/index.php\/open-source\/20200701\/2128\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[348,349,350],"_links":{"self":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2128"}],"collection":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/comments?post=2128"}],"version-history":[{"count":3,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2128\/revisions"}],"predecessor-version":[{"id":2131,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/posts\/2128\/revisions\/2131"}],"wp:attachment":[{"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/media?parent=2128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/categories?post=2128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coderbee.net\/index.php\/wp-json\/wp\/v2\/tags?post=2128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}