runSync<E, A> method

Exit<E, A> runSync<E, A>(
  1. EIO<E, A> zio, {
  2. DeferredIO<Never>? interruptionSignal,
})

Try to run the ZIO synchronously, throwing a Future if it is asynchronous.

Implementation

Exit<E, A> runSync<E, A>(
  EIO<E, A> zio, {
  DeferredIO<Never>? interruptionSignal,
}) {
  assert(!_disposed, 'Runtime has been disposed');
  final result = run(zio, interruptionSignal: interruptionSignal);
  if (result is Future) {
    throw result;
  }
  return result;
}