alpha
Login
or
Join now
tangled.org
/
core
Star
6
Fork
66
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Monorepo for Tangled
tangled.org
Star
6
Fork
66
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
12
Pulls
26
Pipelines
core
/
eventconsumer
/
at
2121200827b05743538f14e5b986e5a8d6ba446b
1 folder
3 files
Mitchell Hashimoto
eventconsumer: add RemoveSource and consolidate per-source state
1mo ago
37303f21
cursor
all: rename go module to tangled.org/core Sets up a special-case handler for serving tangled.org/core go module, plus some misc. .sh -> .org renames. Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>
9 months ago
consumer.go
eventconsumer: add RemoveSource and consolidate per-source state Adds `RemoveSource` to stop streaming from a previously registered source. Removing a source cancels its connection loop and closes any in-flight websocket so the loop exits promptly instead of waiting for the next reconnect tick. Per-source runtime state (the loop's cancel func and the active websocket conn) was previously split across two sync.Maps and a separate map of registered sources, each with its own locking. That left several races, e.g. the conn was stored in connMap only after a successful dial, so a remove during the dial would miss it. The new design collapses everything into a single `sources map[Source]*sourceState` guarded by `sourcesMu`. The lock is only held for short, non-blocking map mutations and is always released before any side effect possibly-blocking calls. `runConnection` now re-checks under the lock that the source is still registered (and the ctx not cancelled) before installing a freshly dialed conn, and its deferred cleanup only clears the conn slot if the entry still points at the conn it installed. This makes 'remove during dial' and 'remove during read' both deterministic: the cancel cuts the loop, the close breaks ReadMessage, and a concurrent runConnection cannot resurrect state for a removed source.
1 month ago
knot.go
eventconsumer: extract knotclient/events into its own package Signed-off-by: oppiliappan <me@oppi.li>
1 year ago
spindle.go
eventconsumer: extract knotclient/events into its own package Signed-off-by: oppiliappan <me@oppi.li>
1 year ago