Monorepo for Tangled โ€” https://tangled.org

knotclient: introduce event consumer #226

merged
opened by oppi.li targeting master from push-lrzzmtxokrxw

generic websocket consumer for one or more event streams from knots

Signed-off-by: oppiliappan me@oppi.li

0
by oppi.li 1 comment
expand 1 commit
knotclient: introduce event consumer

Nice, mostly OK. Some points to improve on:

  • let's not embed the context in the struct; https://go.dev/blog/context-and-structs is a good read for idiomatic context use. Essentially, Start(ctx context.Context) is best, and the caller can decide how they want to handle cancellation. Consequently this context is then passed down to c.worker, c.runConnection etc.

  • perhaps we can make EventConsumer.jobQueue size configurable? With a default set to 100, maybe.

Rest looks good!

sign up or login to add to the discussion
1
by oppi.li 0 comments
expand 1 commit
knotclient: introduce event consumer
sign up or login to add to the discussion
2
by oppi.li 1 comment
expand 1 commit
knotclient: introduce event consumer
pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lqyxae4s3k22