@@ -37,7 +37,7 @@ type Manager struct {
3737////////////////////////////////////////////////////////////////////////////////
3838// LIFECYCLE
3939
40- // New creates a new media object
40+ // New creates a new task manager
4141func New (ctx context.Context , opts ... Opt ) (_ * Manager , err error ) {
4242 self := new (Manager )
4343 if err := self .apply (opts ); err != nil {
@@ -302,9 +302,10 @@ func (m *Manager) Remove(ctx context.Context, id uuid.UUID) (err error) {
302302
303303// Wait blocks until the task registered under id finishes, or until ctx is
304304// done, whichever comes first, then returns its final status. It returns an
305- // error if the task hasn't been started (there's nothing to wait for), or if
306- // the task itself returned an error (joined into err, alongside a context
307- // error if ctx is what ended the wait).
305+ // error if the task hasn't been started (there's nothing to wait for), if
306+ // ctx ends the wait first (no status is returned in that case, since the
307+ // task may still be running), or if the task itself returned an error (its
308+ // status is still returned alongside that error).
308309func (m * Manager ) Wait (ctx context.Context , id uuid.UUID ) (_ * schema.Status , err error ) {
309310 ctx , endSpan := otel .StartSpan (m .tracer , ctx , "Wait" ,
310311 attribute .String ("uuid" , id .String ()),
0 commit comments