invoke

context(incarnation: Incarnation<T, *>, node: Node<T>)
operator fun <T> Molecule.invoke(concentration: T = incarnation.createConcentration())

Assigns the given concentration to this Molecule on the current Node.

Context receivers:

  • incarnation: used to create concentrations by default when none is provided.

  • node: the target Node that will receive the concentration.

Receiver

the molecule to which the concentration will be assigned

Parameters

concentration

the concentration value to assign; when omitted, a fresh concentration instance is created via Incarnation.createConcentration.


context(incarnation: Incarnation<T, *>, node: Node<T>)
operator fun <T> String.invoke(concentration: T = incarnation.createConcentration())

Create the Molecule identified by this string using the current Incarnation and assign it the provided concentration on the current Node.

Context receivers:

  • incarnation: used to create the molecule and, by default, the concentration.

  • node: the target Node that will receive the concentration.

Receiver

the molecule name (string) to create

Parameters

concentration

the concentration value to assign; when omitted, a fresh concentration instance is created via Incarnation.createConcentration.