sourcegraph/internal/goroutine
Robert Lin f88df4c44c
lib/managedservicesplatform: init MSP runtime, add lib/background from internal/goroutine (#57651)
Part of #56846 - initializes a `lib/managedservicesplatform` package that can be imported from other repositories. See `lib/managedservicesplatform/example` for details. It doesn't do much, but emulates Sourcegraph's internal service stuff somewhat, just stripped down significantly (we only need to support a single service per binary), and using generics.

To support the new Accounts service, I've also moved parts of background routine management into `lib/background`, aliased from the original `internal/goroutine` package to maintain compatibility - the utilities here are a bit hefty to copy-paste, and I think it's useful to share this.

## Test plan

```
PORT=8080 VARIABLE=24 go run ./managedservicesplatform/example
```

```
curl localhost:8080
```
2023-10-28 03:08:12 +00:00
..
recorder ci: re-enable race detection (#52776) 2023-06-05 20:41:47 +02:00
background.go lib/managedservicesplatform: init MSP runtime, add lib/background from internal/goroutine (#57651) 2023-10-28 03:08:12 +00:00
BUILD.bazel lib/managedservicesplatform: init MSP runtime, add lib/background from internal/goroutine (#57651) 2023-10-28 03:08:12 +00:00
CODENOTIFY codenotify: dr. fritz is kil (#57313) 2023-10-03 16:19:55 +00:00
example_test.go goroutine: Refactor constructors for periodic goroutines (#52806) 2023-06-01 17:44:38 -05:00
goroutine.go lib/managedservicesplatform: init MSP runtime, add lib/background from internal/goroutine (#57651) 2023-10-28 03:08:12 +00:00
mocks_test.go chore: Update go-mockgen (#44305) 2022-11-11 19:24:00 +00:00
periodic_test.go goroutine: Don't silently stop after panic (#57675) 2023-10-19 20:57:27 +02:00
periodic.go goroutine: Don't silently stop after panic (#57675) 2023-10-19 20:57:27 +02:00