{
  "id": "fn-flow-throttle",
  "dataComponent": "flow",
  "heading": {
    "title": "throttle",
    "badges": [
      "Flow",
      "PARTIAL"
    ]
  },
  "synopsis": "Produces an InkTransform that delays each item by a specified number of milliseconds, controlling the pace of iteration from an InkIterator or InkTransform.",
  "codeBlocks": [
    "extend(\"flow\")\n\n# 1) Basic usage => throttle(100) with an InkIterator\niter = ink(1,6)  # yields [1,2,3,4,5]\nthrottled = flow:throttle(100, iter)\n\n# Convert to array => you'll see a ~100ms delay between each item behind the scenes.\narr = flow:to_array(throttled)\nsput(arr)\n# => [1,2,3,4,5]\n\n# 2) Partial usage => specify ms but wait for the source:\nth100 = flow:throttle(100)\nxform = flow:trans(x => x*10, ink(0,3))\n\nres = flow:to_array( th100(xform) )\nsput(res)\n# => [0,10,20], each item delayed 100ms\n\n# 3) Combining with existing transforms or partial usage => no difference, just returns a new InkTransform that sleeps between items.\n"
  ],
  "notes": [
    "Takes (ms, source). If ms or source is missing or placeholder, partial usage is returned. If both are known, returns an InkTransform that sleeps ms milliseconds between yields.",
    "source can be an InkIterator or another InkTransform. Once you pull items (e.g. with flow:to_array), each retrieval is delayed by ms.",
    "If ms < 0, bridging might raise an error. If the source ends, the transform yields NO_MORE_DATA normally."
  ]
}
