Skip to content

Spawn

Name Mandatory Description Default Type
⬅️ Input Any input type is accepted. The input of this shard will be given as input for the specified Wire Any
Output ➡️ Outputs the specific copy of the Wire that was scheduled. Wire
Wire No The Wire to schedule and run asynchronously none NoneWire[Shard]

Schedules the specified Wire and runs it asynchronously. The current Wire will continue its execution independently of the specified Wire. Unlike Detach, a copy of the specified Wire is scheduled every time the shard is called.

Details

The child wire scheduled makes copies of the context variables of the parent wire. Any changes to said variables will not be reflected on the parent wire.

Child wire is scheduled asynchronously and executes independently of the parent wire. Any pauses on the child wire will not pause the parent wire.

Child wire is scheduled on the same mesh as the parent wire.

Multiple copies of the specified wire can be scheduled. Everytime spawn is called, it will create and schedule a new copy of the wire.

Examples

1
2
3
4
5
6
@wire(logic {
  IsMore(10) | Or | IsLess(0)
})

11 | Spawn(logic) >= ccc
Wait(ccc) | Assert.Is(true Break: true)