import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/head";
import * as tsplus_module_2 from "@effect/core/stm/TQueue/operations/takeUpTo";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/map";
/**
 * Takes a single element from the queue, returning `None` if the queue is
 * empty.
 *
 * @tsplus getter ets/TQueue poll
 */

export function poll(self) {
  return tsplus_module_3.map_(tsplus_module_2.takeUpTo_(self, 1), _ => tsplus_module_1.head(_));
}
//# sourceMappingURL=poll.mjs.map