mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-18 10:13:14 +00:00
20 lines
452 B
Nim
20 lines
452 B
Nim
import pkg/chronos
|
|
import ../statemachine
|
|
import ../salesagent
|
|
import ./errorhandling
|
|
import ../../asyncyeah
|
|
|
|
type
|
|
SaleIgnored* = ref object of ErrorHandlingState
|
|
|
|
method `$`*(state: SaleIgnored): string = "SaleIgnored"
|
|
|
|
method run*(state: SaleIgnored, machine: Machine): Future[?State] {.asyncyeah.} =
|
|
let agent = SalesAgent(machine)
|
|
let context = agent.context
|
|
|
|
if onIgnored =? context.onIgnored:
|
|
onIgnored()
|
|
|
|
await agent.unsubscribe()
|