decred / vspd

A Voting Service Provider (VSP) for the Decred network.
ISC License
18 stars 21 forks source link

Move vspd to an internal package. #436

Closed jholdstock closed 1 year ago

jholdstock commented 1 year ago

Requires #434

This series of commits culminates in the vspd code being moved to an internal package. Along the way it decouples the webapi package from vspd code, and moves both the webapi and vspd components to a new pattern for starting/stopping subsystems, namely:

var wg sync.WaitGroup
wg.Add(1)
go func() {
    foo_that_blocks_until_ctx_done(ctx)
        wg.Done()
}()
...
wg.Wait()

This is desirable because it is concise and easy to understand. Adding to and removing from waitgroups all in one place is a good practise to be following.