zio.blocks.scope.Wire.Shared
See theShared companion object
A wire that produces a reference-counted shared instance via Resource.shared .
The underlying instance may be shared across multiple allocating scopes. A reference count tracks usage, and the instance is released when the last referencing scope is closed. This is the default wire type produced by shared[T].
Type parameters
In
the dependencies required to construct the service
Out
the service type produced
Value parameters
makeFn
the function that constructs the service given a finalizer and context
Attributes
Companion
object
Source
Wire.scala
Graph
Reset zoom Hide graph Show graph
Supertypes
trait Product
trait Equals
trait Matchable
class Any
Show all
Members list
Returns true since this is a shared wire.
Returns true since this is a shared wire.
Attributes
Returns
always true for shared wires
Source
Wire.scala
Constructs the service using the given scope and context.
Constructs the service using the given scope and context.
Value parameters
ctx
the context providing dependencies
scope
the scope for cleanup registration
Attributes
Returns
the constructed service
Source
Wire.scala
Returns this wire since it is already shared.
Returns this wire since it is already shared.
Attributes
Returns
this wire unchanged
Source
Wire.scala
Converts this Wire to a Resource by providing resolved dependencies.
Converts this Wire to a Resource by providing resolved dependencies.
Value parameters
deps
Context containing all required dependencies
Attributes
Returns
a Resource that creates Out values with memoization
Source
Wire.scala
Converts this shared wire to a unique wire.
Converts this shared wire to a unique wire.
Attributes
Returns
a new unique wire with the same construction function
Source
Wire.scala
Returns true if this wire is unique (creates fresh instances each time).
Returns true if this wire is unique (creates fresh instances each time).
Unique wires create a new instance for each dependent service.
Attributes
Returns
true if this wire is unique, false if shared
Inherited from:
Wire
Source
Wire.scala
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
Inherited from:
Product
Source
Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
Returns
in the default implementation, an Iterator[Any]
Inherited from:
Product
Source
Product.scala