Thank you so far, something to study. Coming back to bigT, there is a bit more:
type
Message*[T] = object
topic*: string
id*: string
msgtype*: string #"p/s", "req/rep", "reply". req/rep requires id
msg*: T
Subscriber*[T] = object
fs*: FutureStream[Message[T]]
subscriptions*: seq[string] #topic strings
topics*: seq[string] #topic strings
source*: string #name of proc
id*: string
Bus*[T] = object
subscribers*: Table[string, Subscriber[T]] #table[subscriber id,
subscriber object]
topicSubscribers*: Table[string, seq[string]] #table[topic string,
seq[subscriber id's]]
fsBus*: FutureStream[Message[T]]
#bus is the input stream for the broker.
#all messages to be distributed should be written to this stream.
var bus* = Bus(
fsBus: newFutureStream[Message[T]](fromProc = "main")
)
Run
this gives an error:
_02.nim(27, 15) Error: object constructor needs an object type [genericBody
declared [...]\psbus_02.nim(19, 3)]
Run