controller

fun <M, E, F> controller(loopFactory: MobiusLoop.Factory<M, E, F>, defaultModel: M): MobiusLoop.Controller<M, E>

Create a MobiusLoop.Controller that allows you to start, stop, and restart MobiusLoops.

Return

a new controller

Parameters

loopFactory

a factory for creating loops

defaultModel

the model the controller should start from


fun <M, E, F> controller(loopFactory: MobiusLoop.Factory<M, E, F>, defaultModel: M, modelRunner: WorkRunner): MobiusLoop.Controller<M, E>

Create a MobiusLoop.Controller that allows you to start, stop, and restart MobiusLoops.

Return

a new controller

Parameters

loopFactory

a factory for creating loops

defaultModel

the model the controller should start from

modelRunner

the WorkRunner to use when observing model changes


fun <M, E, F> controller(loopFactory: MobiusLoop.Factory<M, E, F>, defaultModel: M, init: Init<M, F>): MobiusLoop.Controller<M, E>

Create a MobiusLoop.Controller that allows you to start, stop, and restart MobiusLoops.

Return

a new controller

Parameters

loopFactory

a factory for creating loops

defaultModel

the model the controller should start from

init

the init function to run when a loop starts


fun <M, E, F> controller(loopFactory: MobiusLoop.Factory<M, E, F>, defaultModel: M, init: Init<M, F>, modelRunner: WorkRunner): MobiusLoop.Controller<M, E>

Create a MobiusLoop.Controller that allows you to start, stop, and restart MobiusLoops.

Return

a new controller

Parameters

loopFactory

a factory for creating loops

defaultModel

the model the controller should start from

init

the init function to run when a loop starts

modelRunner

the WorkRunner to use when observing model changes