Swap to implementation pattern, make fields and methods public for extensibility.

This commit is contained in:
Jay
2026-04-19 12:49:49 -04:00
parent 2f7e606064
commit d2528d3ac7
10 changed files with 212 additions and 206 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ import (
type Peer struct {
id string
worker *Worker
worker Worker
}
type WorkerContext struct {
@@ -74,7 +74,7 @@ func NewPool(ctx context.Context, config *PoolConfig, logger *slog.Logger,
// deadlocks.
if config.WorkerFactory == nil {
config.WorkerFactory = func(
ctx context.Context, id string) (*Worker, error) {
ctx context.Context, id string) (Worker, error) {
return NewWorker(ctx, id, config.WorkerConfig)
}
}