Source File
future.go
Belonging Package
github.com/alitto/pond/v2
package pond// Task represents a task that can be waited on. If the task fails, the error can be retrieved.type Task interface {// Done returns a channel that is closed when the task is complete or has failed.Done() <-chan struct{}// Wait waits for the task to complete and returns any error that occurred.Wait() error}// ResultTask represents a task that yields a result. If the task fails, the error can be retrieved.type ResultTask[ any] interface {// Done returns a channel that is closed when the task is complete or has failed.Done() <-chan struct{}// Wait waits for the task to complete and returns the result and any error that occurred.Wait() (, error)}// Result is deprecated. Use ResultTask instead.// This interface is maintained for backward compatibility.//// Deprecated: Use ResultTask instead.type Result[ any] interface {// Done returns a channel that is closed when the task is complete or has failed.Done() <-chan struct{}// Wait waits for the task to complete and returns the result and any error that occurred.Wait() (, error)}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |