text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|> DefaultExecutors
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "Lice<|fim_suffix|>nse.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writi... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2018-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a <|fim_suffix|>) / Math.log(2.0)).ceil.toInt
Math.pow(2.0, nextPow.toDouble).t... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017<|fim_suffix|>ITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package zio.internal
import zio.stacktracer.TracingImplicits.disableAutoTrace
private[zio] object Sync {
@inlin... | fim | zio/zio | scala |
/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_prefix|>package zio.internal
import zio.Duration
priv<|fim_suffix|>= ()
}
<|fim_middle|>ate object WeakConcurrentBagGc {
def start[A <: AnyRef](bag: WeakConcurrentBag[A], every: Duration): Unit <|endoftext|> | fim | zio/zio | scala |
<|fim_suffix|>[String, Long] = {
val builder = scala.collection.mutable.Map[String, Long]()
val it = values.entrySet().iterator()
while (it.hasNext()) {
val e = it.next()
builder.update(e.getKey(), e.getValue().longValue())
}
builder.toMap
}
MetricHook(update... | fim | zio/zio | scala |
<|fim_suffix|>(f: => A): Boolean = {
val _ = f
true
}
@inline def tryLock[A](refs: collection.SortedSet[TRef[?]])(f: => A): Boolean = {
val _ = f
true
}
@inline def tryLock[A](lock: Lock)(f: => A): Boolean = {
val _ = f
true
}
}
<|fim_prefix|>package zio.stm
private object ZSTMLockS... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import java.ti<|fim_suffix|>INUTES => ChronoUnit.MINUTES
case TimeUnit.HOURS => ChronoUnit.HOURS
case TimeUnit.DAYS => ChronoUnit.DAYS
}
}
<|fim_middle|>me.temporal.ChronoUnit
import java.util.concurrent.TimeUnit
private[zio] trait ClockSyntaxPlatformSpeci... | fim | zio/zio | scala |
/*
* Copyright 2018-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | java |
<|fim_prefix|>package zio
import java.time.temporal.ChronoUnit
import java.util.concurrent.TimeUnit
private[zio] trait<|fim_suffix|>lockSyntaxPlatformSpecific {
@inline final protected def toChronoUnit(unit: TimeUnit): ChronoUnit =
unit.toChronoUnit
}
<|fim_middle|> C<|endoftext|> | fim | zio/zio | scala |
<|fim_suffix|>tLinkedDeque[A]
}
<|fim_prefix|>package zio
private[zio] trait QueuePlatfo<|fim_middle|>rmSpecific {
type ConcurrentDeque[A] = java.util.concurrent.Concurren<|endoftext|> | fim | zio/zio | scala |
<|fim_suffix|>me.setExecutor(Executor.makeDefault(autoBlocking = true))
}
}
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a c... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2023-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo<|fim_suffix|> copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_suffix|>
enqHead += 1
}
}
// If there was no space in the queue we return the remainder of the iterator
Chunk.fromIterator(as)
}
override final def poll(default: A): A = {
// Loading all instance fields locally. Otherwise JVM will reload
// them after every volatile read in ... | fim | zio/zio | scala |
package zio.internal
import java.lang.invoke.MethodHandle
import java.lang.invoke.MethodHandles
import java.lang.invoke.MethodType
import java.lang.reflect.{InvocationHandler, Method, Proxy}
import java.util.function.Consumer
import java.util.logging.Logger
/**
* * This class is used to handle system signals in a pl... | fim | zio/zio | scala |
package zio.internal.metrics
private[zio] trait AddersVersionSpecific {
type DoubleAdder = java.util.concurrent.atomic.DoubleAdder
}
<|endoftext|> | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
import zio.metrics._
import java.lang.management.{BufferPoolMXBean, ManagementFactory}
import scala.jdk.CollectionConverters._
final case class BufferPools(
bufferPoolUsedBytes: PollingMetric[Any, Throwable, Chunk[MetricState.Gauge]],
bufferPoolCapacityBytes: Po... | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
import zio.metrics.{Metric, MetricState, PollingMetric}
import java.lang.management.{ClassLoadingMXBean, ManagementFactory}
final case class ClassLoading(
loadedClassCount: PollingMetric[Any, Throwable, MetricState.Gauge],
totalLoadedClassCount: PollingMetric[An... | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
/**
* JVM metrics, compatible with the prometheus-hotspot library, with
* configurable schedule
*/
trait DefaultJvmMetrics {
protected def jvmMetricsSchedule: ULayer[JvmMetricsSchedule]
@deprecated(
"This app exposes JVM metrics with the non-OpenMetrics-c... | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
import zio.metrics._
import java.lang.management.ManagementFactory
import scala.jdk.CollectionConverters._
final case class GarbageCollector(
gcCollectionSecondsSum: PollingMetric[Any, Throwable, Chunk[MetricState.Gauge]],
gcCollectionSecondsCount: PollingMetric... | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
/**
* Configuration for the JVM metrics
*
* @param updateMetrics
* Schedule for periodically updating each JVM metric
* @param reloadDynamicMetrics
* Schedule for regenerating the dynamic JVM metrics such as buffer pool
* metrics
*/
final case class Jvm... | fim | zio/zio | scala |
<|fim_suffix|> }
.orDie
}
}
}
<|fim_prefix|>package zio.metrics.jvm
import com.sun.management.GarbageCollectionNotificationInfo
import zio._
import zio.metrics.Metric.Counter
import zio.metrics._
import java.lang.management.{GarbageCollectorMXBean, ManagementFactory}
import javax.managemen... | fim | zio/zio | scala |
<|fim_suffix|>CommittedBytes,
memoryMaxBytes,
memoryInitBytes,
poolUsedBytes,
poolCommittedBytes,
poolMaxBytes,
poolInitBytes
)
}
}
<|fim_prefix|>package zio.metrics.jvm
import zio._
import zio.metrics._
import java.lang.management.{ManagementFactory, MemoryPo... | fim | zio/zio | scala |
<|fim_suffix|>IO.attempt(getter.invoke(obj).asInstanceOf[Long])
case None =>
ZIO.fail(new IllegalStateException(s"MXReflection#get called on unavailable metri"))
}
private def findGetter(getter: Try[Method]): Option[Method] =
getter match {
case Failure(_) =>
None
... | fim | zio/zio | scala |
<|fim_prefix|>package zio.metrics.jvm
import zio._
import zio.metrics._
import java.lang.management.{ManagementFactory, ThreadMXBean}
final case class Thread(
threadsCurrent: PollingMetric[Any, Throwable, MetricState.Gauge],
threadsDaemon: PollingMetric[Any, Throwable, MetricState.Gauge],
threadsPeak: PollingM... | fim | zio/zio | scala |
<|fim_suffix|>ntime", runtime)
)
.fromConst(1.0)
private def reportVersions()(implicit trace: Trace): ZIO[Any, Throwable, VersionInfo] =
for {
version <- System.propertyOrElse("java.runtime.version", "unknown")
vendor <- System.propertyOrElse("java.vm.vendor", "unknown")
runtime <-... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2018-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use<|fim_suffix|> = false
override val shutdown: Unit = ()
override val shutdownNow: ju.List[... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen<|fim_suffix|>or agreed to in writing, software
* distributed under the License is distributed on an "AS... | fim | zio/zio | scala |
<|fim_suffix|>rmCompletionStage` for a concrete implementation of
* CompletionStage
*/
def fromCompletableFuture[A](cs: => CompletableFuture[A])(implicit trace: Trace): Task[A] =
fromCompletionStage(cs)
def fromCompletionStage[A](cs: => CompletionStage[A])(implicit trace: Trace): Task[A] =
javaz.from... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import zio.internal._
import zio.stacktracer.TracingImplicits.disableAutoTrace
private[zio] trait ZIOAppPlatformSpecific { self: ZIOApp =>
/**
* The Scala main function, intended to be called only by the Scala runtime.
*/
final def main(args0: Array[String]): Unit = {
implicit... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Lic<|fim_suffix|>.attemptBlocking(f.close()).orDie
) { f =>
ZIO.attemptBlockingIO(f.write(content))
}
def writeFile(path: => Path, content: => String)(implicit
trace: Trace,
d: DummyImplicit
): ZIO[Any, IOE... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import zio.interop.javaz
<|fim_suffix|> val v0 = v
if (v0 == null) Exit.failNone
else Exit.succeed(v0)
}
}
<|fim_middle|>
import java.nio.channels.CompletionHandler
import java.util.concurrent.{CompletableFuture, CompletionStage, Future}
private[zio] trait ZIOPlatformSpecif... | fim | zio/zio | scala |
<|fim_suffix|> val keepAliveTime = 60000L
val timeUnit = TimeUnit.MILLISECONDS
val workQueue = new SynchronousQueue[Runnable]()
val threadFactory = new NamedThreadFactory("zio-default-blocking", true)
val threadPool = new ThreadPoolExecutor(
corePoolSize,
maxPoolSize... | fim | zio/zio | scala |
<|fim_suffix|>rrentSubscribersIndex + capacity)
loop = false
} else {
val currentSliding = sliding.get(currentIndex)
if (currentSliding == currentSubscribersIndex + capacity) {
currentSubscribersIndex += 1
} else {
val currentState = state.get
... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the Lic<|fim_suffix|>io] abstract class DefaultExecutors {
final def ma... | fim | zio/zio | scala |
/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_suffix|>
private[zio] object OneShot {
private final val nanosPerMilli = 1000000L
/**
* Makes a new (unset) variable.
*/
def make[A]: OneShot[A] = new OneShot()
final class TimeoutException extends Error("Timed out waiting for variable to be set")
}
<|fim_prefix|>/*
* Copyright 2017-2024 John A.... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>package zio.internal
import zio.Duration
import java.util.concurrent.atomic.AtomicInteger
<|fim_suffix|>urrentBag.GcThread-${i.getAndIncrement()}")
thread.setPriority(4)
thread.setDaemon(true)
thread.start()
}
}
<|fim_middle|>import java.util.concurrent.locks.LockSupport
private final cl... | fim | zio/zio | scala |
/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_suffix|>ala's `Double` implementation does not play nicely with Java's
* `AtomicReference.compareAndSwap` as `compareAndSwap` uses Java's `==`
* reference equality when it performs an equality check. This means that even
* if two Scala `Double`s have the same value, they will still fail
* `compareAndSwap` as ... | fim | zio/zio | scala |
package zio.interop
/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.... | fim | zio/zio | scala |
<|fim_prefix|>package zio.stm
import java.util.concurrent.locks.ReentrantLock
import scala.collection.SortedSet
private object ZSTMLockSupport {
type Lock = ReentrantLock
object Lock {
def apply(fair: Boolean = false): Lock = new ReentrantLock(fair)
}
@inline def lock[A](refs: SortedSet[TRef[?]])(f: => ... | fim | zio/zio | scala |
<|fim_suffix|> if (locked) { f; true }
else false
} finally unlock(acquired, i)
}
private def unlock(locks: Array[ReentrantLock], upTo: Int): Unit = {
var i = 0
while (i < upTo) {
locks(i).unlock()
i += 1
}
}
}
<|fim_prefix|>package zio.stm
import zio.stm.ZSTM.internal.{Loc... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import java.util.concurrent.ConcurrentLinkedQueue
import scala.collection.mutable
private[zio] trait QueuePlatformSpecific {
// java.util.concurrent.ConcurrentLinkedDeque is not available in Scala Native, so we need to createa custom `addFirst` method
private[<|fim_suffix|>: AnyRef] ext... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2018-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>_ + v)
def sum(): Double = ref.get()
}
}
<|fim_prefix|>package zio.internal.metrics
private[zio] trait AddersVersionSpecific {
protected f<|fim_middle|>inal class DoubleAdder {
private val ref = AtomicDouble.make(0.0d)
def add(v: Double): Unit = ref.updateAndGet(<|endoftext|> | fim | zio/zio | scala |
<|fim_suffix|>anual
/**
* Creates a new [[Cached]] value that must be manually refreshed by calling
* the refresh method. Note that error retrying is not performed
* automatically, so if you want to retry on errors, you should first apply
* retry policies to the acquisition effect before passing it to th... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2019-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian<|fim_suffix|>toTrace
import scala.concurrent.duration.{Duration => ScalaDuration}
import scala.concurrent.{CanAwait, Exe... | fim | zio/zio | scala |
<|fim_suffix|>[E] =
foldLog[Cause[E]](
Empty,
(e, trace, spans, annotations) => Fail(e, f(trace), spans, annotations),
(t, trace, spans, annotations) => Die(t, f(trace), spans, annotations),
(fiberId, trace, spans, annotations) => Interrupt(fiberId, f(trace), spans, annotations)
)(
... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>](config: Config[A])
extends Fallback[Option[A]](config.map(Some(_)), Config.succeed(None)) {
override def condition(error: Config.Error): Boolean = error.isMissingDataOnly
}
final case class FallbackWith[A](
override val first: Config[A],
override val second: Config[A],
f: Confi... | fim | zio/zio | scala |
<|fim_suffix|>ail(index: Int): Either[Config.Error, leftType] =
Left(
Config.Error.MissingData(
prefix,
s"The element at index ${index} in a sequence at ${path} was missing"
... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/<|fim_suffix|>ithPatch[
ZEnvironment[Clock & Console & System & Random & ConfigProvider],
ZEnvironment.Patch[
Clock & Console & System & Random & ConfigProvider,
Clock & Console & System & Random & ConfigProvider
]
] =
FiberRef.unsafe.makeEnvironment(live)(Unsafe)
}
<|fim_mi... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import zio.internal.IsFatal
import scala.annotation.tailrec
/**
* A `Differ[Value, Patch]` knows how to compare an old value and new value of
* type `Value` to produce a patch of type `Patch` that describes the
* differences between those values. A `Differ` also knows how to apply a patc... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not us<|fim_suffix|>www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Lic... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
/*
* Copyright 2020-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_suffix|>t thread is part of this executor.
* @note
* This method is only ovewritten in the ZScheduler
*/
private[zio] def isCurrentThreadInExecutor: Boolean =
false
}
object Executor extends DefaultExecutors with Serializable {
private final class Interop(executor: Executor) extends java.util.... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except i<|fim_suffix|>
val success: ExitCode = ExitCode(0)
val failure: ExitCode = ExitCode(1)
}
<|fim_middle|>n compliance with the Lic... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>ions and
* limitations under the License.
*/
package zio
import zio.stacktracer.TracingImplicits.disableAutoTrace
import java.io.{PrintStream, PrintWriter}
/**
* Represents a failure in a fiber. This could be caused by some non-
* recoverable error, such as a defect or system error, by some typed ... | fim | zio/zio | scala |
<|fim_suffix|>zio] object Gen {
/**
* Generates a fiber ID where the `id` is a random integer.
*
* This is more performant than using `FiberId.Gen.Ordered`, but cannot be
* used in cases that rely on strict ordering of fibers (e.g., in zio-test)
*/
object Live extends Gen {
def m... | fim | zio/zio | scala |
/*
* Copyright 2019-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>thing, Z]
def apply(f: (A, B, C, D) => Z)(implicit trace: Trace): ZIO[A with B with C with D, Nothing, Z] =
ZIO.environmentWith[A with B with C with D](env => f(env.get[A], env.get[B], env.get[C], env.get[D]))
}
implicit def function5Constructor[A: Tag, B: Tag, C: Tag, D: Tag, F: Tag,... | fim | zio/zio | scala |
<|fim_suffix|>ache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing pe... | fim | zio/zio | scala |
<|fim_suffix|>[R: HasNoScope](...) = ..."""
)
sealed trait HasNoScope[R]
object HasNoScope extends HasNoScopeCompanionVersionSpecific {
override val instance: HasNoScope[Any] = new HasNoScope[Any] {}
}
<|fim_prefix|>package zio
@scala.annotation.implicitNotFound(
"""Can not prove that ${R} does not contain Scope.... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2021-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>language governing permissions and
* limitations under the License.
*/
package zio
import zio.stacktracer.TracingImplicits.disableAutoTrace
/**
* The [[InterruptStatus]] of a fiber determines whether or not it can be
* interrupted. The status can change over time in different regions.
*
* If a fi... | fim | zio/zio | scala |
<|fim_suffix|>1. The type is either a trait or a class with an empty primary constructor." +
"\n 2. The type includes only ZIO methods or vals." +
"\n 3. The type does not have any abstract type members."
)
trait IsReloadable[Service] {
def reloadable(scopedRef: ScopedRef[Service]): Service
}
object IsReloa... | fim | zio/zio | scala |
<|fim_prefix|>package zio
import zio.stacktracer.TracingImplicits.disableAutoTrace
import scala.annotation.implicitNotFound
@implicitNotFound("\nThis operator requires that the output type be a subtype of ${B}\nBut the actual type was ${A}.")
sealed abstract class IsSubtypeOfOutput[-A, +B] extends (A => B) with Seri... | fim | zio/zio | scala |
<|fim_suffix|>ng, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package zio
/**
* A `LogAnnotation` ... | fim | zio/zio | scala |
<|fim_suffix|>
LogLevel.All,
LogLevel.Trace,
LogLevel.Debug,
LogLevel.Info,
LogLevel.Warning,
LogLevel.Error,
LogLevel.Fatal,
LogLevel.None
)
implicit val orderingLogLevel: Ordering[LogLevel] = Ordering.by(_.ordinal)
}
<|fim_prefix|>/*
* Copyright 2019-2024 John A. De Goes and the ... | fim | zio/zio | scala |
<|fim_suffix|> now)(Unsafe)
sb.toString()
}
}
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2020-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>[zippable.Out]
def zipWithIndex: CC[(A, Int)]
}
<|fim_prefix|>package zio
import scala.reflect.ClassTag
trait NonEmptyOps[+A, CC[+_], EC[+_]] {
def collect[B](pf: PartialFunction[A, B]): EC[B]
def exists(p: A => Boolean): Boolean
def filter(p: A => Boolean): EC[A]
def filterNot(p: A => Boolean... | fim | zio/zio | scala |
<|fim_suffix|>A]
def prepended[B >: A](elem: B): CC[B]
def reverse: CC[A]
def sortBy[B](f: A => B)(implicit ord: Ordering[B]): CC[A]
def sorted[B >: A](implicit ord: Ordering[B]): CC[B]
}
<|fim_prefix|>package <|fim_middle|>zio
trait NonEmptySeq[+A, CC[+_], EC[+_]] extends NonEmptyOps[A, CC, EC] {
def append... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>def handleSurplus(
as: Iterable[A],
queue: MutableConcurrentQueue[A],
takers: ConcurrentDeque[Promise[Nothing, A]],
isShutdown: AtomicBoolean
)(implicit trace: Trace): UIO[Boolean] = {
def unsafeSlidingOffer(as: Iterable[A]): Unit =
if (!as.isEmpty &... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_prefix|>/*
* Copyright 2017-2024 John A. De Goes and the ZIO Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | fim | zio/zio | scala |
<|fim_suffix|>ayer.
*/
def autoFromConfig[In, E, Out: Tag](
layer: ZLayer[In, E, Out],
scheduleFromConfig: ZEnvironment[In] => Schedule[In, Any, Any]
)(implicit
trace: Trace
): ZLayer[In, E, Reloadable[Out]] =
ZLayer.scoped[In] {
for {
in <- ZIO.environment[In]
sche... | fim | zio/zio | scala |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.