Packages

p

izumi.distage

planning

package planning

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package extensions
  2. package sequential
  3. package solver

Type Members

  1. final case class AutoSetHook[BINDING](includeOnly: InclusionPredicate, name: Option[Identifier], weak: Boolean, pos: CodePosition)(implicit evidence$1: Tag[BINDING]) extends PlanningHook with Product with Serializable

    A hook that will collect all implementations with types that are

    A hook that will collect all implementations with types that are

    _ <: T

    into a Set[T] set binding available for summoning.

    This class is not intended to be used directly, there is a convenience helper, AutoSetModule.

    Usage:

    val collectCloseables = AutoSetHook[AutoCloseable]("closeables")
    
    val injector = Injector(new BootstrapModuleDef {
      many[PlanningHook]
        .add(collectCloseables)
    })

    Then, in any class created from injector:

    class App(allCloseables: Set[AutoCloseable]) {
      ...
    }

    These Auto-Sets can be used (just as example) to implement custom lifecycles:

    val locator = injector.produce(modules)
    
    val closeables = locator.get[Set[AutoCloseable]]("closeables")
    try { locator.get[App].runMain() } finally {
      // reverse closeables list, Auto-Sets preserve order, in the order of *initialization*
      // Therefore resources should closed in the *opposite order*
      // e.g. if C depends on B depends on A, create: A -> B -> C, close: C -> B -> A
      closeables.reverse.foreach(_.close())
    }
  2. abstract class AutoSetModule extends BootstrapModuleDef

    Auto-Sets collect all bindings with static types of _implementations_ that are _ <: T into a summonable Set[T]

    Auto-Sets collect all bindings with static types of _implementations_ that are _ <: T into a summonable Set[T]

    See also

    AutoSetHook

    same concept in MacWire: https://github.com/softwaremill/macwire#multi-wiring-wireset

  3. trait BindingTranslator extends AnyRef
  4. class PlannerDefaultImpl extends Planner
    Annotations
    @nowarn()
  5. final class PlanningHookAggregate extends PlanningHook
  6. final class PlanningObserverAggregate extends PlanningObserver
  7. trait SubcontextHandler[+E] extends AnyRef

Value Members

  1. object AutoSetHook extends Serializable
  2. object AutoSetModule
  3. object BindingTranslator
  4. object SubcontextHandler

Ungrouped