import * as tsplus_module_1 from "@effect/core/io/FiberId/operations/none";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/asyncMaybe";
export const _async = _async_1;
export const asyncBlockingOn = asyncBlockingOn_1;
/**
 * Imports an asynchronous side-effect into a pure `Effect` value. See
 * `asyncMaybe` for the more expressive variant of this function that can
 * return a value synchronously.
 *
 * The callback function `Effect<R, E, A> => any` must be called at most once.
 *
 * @tsplus static ets/Effect/Ops async
 */

function _async_1(register, __tsplusTrace) {
  return asyncBlockingOn_1(register, tsplus_module_1.none, __tsplusTrace);
}

export { _async_1 as async };
/**
 * Imports an asynchronous side-effect into a pure `Effect` value. See
 * `asyncMaybe` for the more expressive variant of this function that can
 * return a value synchronously.
 *
 * The callback function `Effect<R, E, A> => any` must be called at most once.
 *
 * The list of fibers, that may complete the async callback, is used to
 * provide better diagnostics.
 *
 * @tsplus static ets/Effect/Ops asyncBlockingOn
 */

function asyncBlockingOn_1(register, blockingOn, __tsplusTrace) {
  return tsplus_module_3.asyncMaybeBlockingOn(cb => {
    register(cb);
    return tsplus_module_2.none;
  }, blockingOn, __tsplusTrace);
}
//# sourceMappingURL=async.mjs.map