import * as tsplus_module_1 from "@effect/core/io/Queue/operations/strategy";
import * as tsplus_module_2 from "@effect/core/io/Queue/external/create";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/mutable/MutableQueue/bounded";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/flatMap";
/**
 * Makes a new bounded queue with the dropping strategy. When the capacity of
 * the queue is reached, new elements will be dropped.
 *
 * **Note**: When possible use only power of 2 capacities; this will provide
 * better performance by utilising an optimised version of the underlying
 * `RingBuffer`.
 *
 * @tsplus static ets/Queue/Ops dropping
 */

export function dropping(requestedCapacity, __tsplusTrace) {
  return tsplus_module_5.flatMap_(tsplus_module_4.succeed(() => tsplus_module_3.bounded(requestedCapacity), __tsplusTrace), queue => tsplus_module_2.create(queue, tsplus_module_1.dropppingStrategy(), __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=dropping.mjs.map