20 lines
737 B
Nim
Raw Normal View History

2025-02-10 14:49:30 +01:00
import pkg/chronos
import pkg/questionable/results
2025-02-10 15:34:41 +01:00
type Component* = ref object of RootObj
2025-02-10 14:49:30 +01:00
method awake*(c: Component): Future[?!void] {.async, base.} =
# Awake is called on all components in an unspecified order.
# Use this method to subscribe/connect to other components.
return success()
2025-02-10 16:24:54 +01:00
method start*(c: Component): Future[?!void] {.async, base.} =
# Start is called on all components in an unspecified order.
# Is is guaranteed that all components have already successfulled handled 'awake'.
# Use this method to begin the work of this component.
return success()
2025-02-10 14:49:30 +01:00
method stop*(c: Component): Future[?!void] {.async, base.} =
# Use this method to stop, unsubscribe, and clean up any resources.
return success()