Ivan Folgueira Bande 969b42bfb5 chore(cbindings): Thread-safe libwaku. WakuNode instance created directly from the Waku Thread (#1957)
* libwaku: create the WakuNode in the Waku thread. Not in the main thread
* node_lifecycle_request.nim: moving hard-coded value to a const item
* libwaku.nim: start using 'isOkOr' instead of 'isErr()'-approach
* node_lifecycle_request.nim: better 'async' & 'await' usage. Not block the runtime
2023-09-01 08:37:02 +02:00

22 lines
459 B
Nim

# This file contains the base message request type that will be handled
# by the Waku Node thread.
import
std/json,
stew/results
import
chronos
import
../../../waku/node/waku_node,
../waku_thread
type
InterThreadRequest* = ref object of RootObj
method process*(self: InterThreadRequest, node: ptr WakuNode):
Future[Result[string, string]] {.base.} = discard
proc `$`*(self: InterThreadRequest): string =
return $( %* self )