Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/alitto/pond
/ functions
Functions
262 in github.com/alitto/pond
⨍
Functions
262
◇
Types & classes
30
↓ 438 callers
Function
Equal
** * Asserts that the expected and actual values are equal. */
internal/assert/assert.go:8
↓ 117 callers
Method
Wait
Wait waits for the task to complete and returns any error that occurred.
future.go:10
↓ 79 callers
Method
Submit
Submits a task to the pool and returns a future that can be used to wait for the task to complete. The pool will not accept new tasks after it has bee
pool.go:107
↓ 47 callers
Function
NewPool
NewPool creates a new pool with the given maximum concurrency and options. The new maximum concurrency must be greater than or equal to 0 (0 means no
pool.go:603
↓ 39 callers
Method
StopAndWait
Stops the pool and waits for all tasks to complete.
pool.go:84
↓ 36 callers
Function
True
** * Asserts that the actual value is true. */
internal/assert/assert.go:18
↓ 34 callers
Method
RunningWorkers
Returns the number of worker goroutines that are currently active (executing a task) in the pool.
pool.go:40
↓ 30 callers
Method
Done
Done returns a channel that is closed when the task is complete or has failed.
future.go:7
↓ 28 callers
Method
CompletedTasks
Returns the total number of tasks that have completed (either successfully or with an error). Tasks accepted by the pool but canceled before execution
pool.go:56
↓ 27 callers
Method
SubmitErr
Submits a task to the pool and returns a future that can be used to wait for the task to complete. The task function must return an error. The pool wi
pool.go:113
↓ 26 callers
Method
SubmittedTasks
Returns the total number of tasks submitted to the pool since its creation.
pool.go:43
↓ 21 callers
Method
FailedTasks
Returns the number of tasks that have completed with an error.
pool.go:49
↓ 21 callers
Method
NewSubpool
Creates a new subpool with the specified maximum concurrency and options.
pool.go:129
↓ 21 callers
Method
SuccessfulTasks
Returns the number of tasks that have completed successfully.
pool.go:52
↓ 19 callers
Method
WaitingTasks
Returns the number of tasks that are currently waiting in the pool's queue.
pool.go:46
↓ 15 callers
Method
DroppedTasks
Returns the number of tasks that have been dropped because the queue was full.
pool.go:59
↓ 15 callers
Method
MaxConcurrency
Returns the maximum concurrency of the pool.
pool.go:66
↓ 15 callers
Method
NewGroup
Creates a new task group.
pool.go:132
↓ 15 callers
Method
Stop
Stops the pool and returns a future that can be used to wait for all tasks pending to complete. The pool will not accept new tasks after it has been s
pool.go:81
↓ 15 callers
Method
Write
Write writes a value to the buffer. If the buffer is full, it returns an EOF error.
internal/linkedbuffer/buffer.go:38
↓ 14 callers
Method
Read
Read reads a value from the buffer. If the buffer is empty, it returns an EOF error. If the buffer has been read completely, it returns an EOF error.
internal/linkedbuffer/buffer.go:52
↓ 13 callers
Method
Error
()
internal/future/future.go:53
↓ 12 callers
Function
WithQueueSize
WithQueueSize sets the max number of elements that can be queued in the pool.
pooloptions.go:17
↓ 11 callers
Method
Len
Len returns the number of elements in the buffer.
internal/linkedbuffer/buffer.go:32
↓ 10 callers
Method
Err
()
internal/future/future.go:20
↓ 8 callers
Function
WithContext
WithContext sets the context for the pool.
pooloptions.go:10
↓ 7 callers
Method
CanceledTasks
Returns the number of tasks accepted by the pool that were canceled before executing user code due to pool context cancellation.
pool.go:63
↓ 7 callers
Function
PanicsWithError
** * Asserts that the function panics with the expected error. */
internal/assert/assert.go:42
↓ 6 callers
Method
NewGroupContext
Creates a new task group with the specified context.
pool.go:135
↓ 6 callers
Method
ReadCount
ReadCount returns the number of elements read from the buffer since it was created
internal/linkedbuffer/linkedbuffer.go:98
↓ 6 callers
Method
Resize
Resizes the pool by changing the maximum concurrency (number of workers) of the pool. The new max concurrency must be greater than 0. If the new max c
pool.go:92
↓ 6 callers
Method
TrySubmit
Attempts to submit a task to the pool and returns a future that can be used to wait for the task to complete and a boolean indicating whether the task
pool.go:119
↓ 5 callers
Method
Context
Returns the context associated with this pool.
pool.go:77
↓ 5 callers
Method
Go
Submits a task to the pool without waiting for it to complete. The pool will not accept new tasks after it has been stopped. If the pool has been stop
pool.go:102
↓ 5 callers
Function
NewFuture
(ctx context.Context)
internal/future/future.go:37
↓ 5 callers
Method
Stopped
Returns true if the pool has been stopped or its context has been cancelled.
pool.go:87
↓ 5 callers
Method
TrySubmitErr
Attempts to submit a task to the pool and returns a future that can be used to wait for the task to complete and a boolean indicating whether the task
pool.go:126
↓ 5 callers
Function
newPool
(maxConcurrency int, parent *pool, options ...Option)
pool.go:550
↓ 5 callers
Method
updateMetrics
(err error)
pool.go:507
↓ 4 callers
Method
Cap
Cap returns the capacity of the buffer.
internal/linkedbuffer/buffer.go:27
↓ 4 callers
Method
TrySubmit
Attempts to submit a task to the pool and returns a future that can be used to wait for the task to complete and a boolean indicating whether the task
result.go:28
↓ 4 callers
Method
TrySubmitErr
Attempts to submit a task to the pool and returns a future that can be used to wait for the task to complete and a boolean indicating whether the task
result.go:35
↓ 4 callers
Method
Wait
Waits for all tasks in the group to complete. If any of the tasks return an error, the group will return the first error encountered. If the context i
group.go:30
↓ 4 callers
Method
notifySubmitWaiter
()
pool.go:498
↓ 4 callers
Method
readTask
()
pool.go:462
↓ 4 callers
Method
submit
(task any, nonBlocking bool)
result.go:77
↓ 4 callers
Method
submit
(task any, nonBlocking bool)
pool.go:361
↓ 4 callers
Method
wrapAndSubmit
(task any, nonBlocking bool)
pool.go:337
↓ 3 callers
Method
Done
Returns a channel that is closed when all tasks in the group have completed, a task returns an error, or the group is stopped.
group.go:33
↓ 3 callers
Method
QueueSize
Returns the size of the task queue.
pool.go:69
↓ 3 callers
Function
Submit
Submit submits a task to the default pool and returns a future that can be used to wait for the task to complete.
default.go:7
↓ 3 callers
Method
Submit
Submits a task to the pool and returns a future that can be used to wait for the task to complete and get the result. The pool will not accept new tas
result.go:16
↓ 3 callers
Method
Wait
Wait waits for the future to complete and returns any error that occurred.
internal/future/future.go:33
↓ 3 callers
Method
WriteCount
WriteCount returns the number of elements written to the buffer since it was created
internal/linkedbuffer/linkedbuffer.go:93
↓ 3 callers
Method
launchWorker
(task any)
pool.go:451
↓ 2 callers
Method
Cancel
(cause error)
internal/future/composite.go:77
↓ 2 callers
Method
Context
Returns the context associated with this group. This context will be cancelled when either the parent context is cancelled or any task in the group re
group.go:41
↓ 2 callers
Method
NonBlocking
Returns true if the pool is non-blocking, meaning that it will not block when the task queue is full. In a non-blocking pool, tasks that cannot be sub
pool.go:74
↓ 2 callers
Method
Result
()
internal/future/value.go:21
↓ 2 callers
Method
Stopped
()
pool.go:163
↓ 2 callers
Method
Submit
Submits a task to the group.
group.go:20
↓ 2 callers
Method
SubmitErr
Submits a task to the group that can return an error.
group.go:23
↓ 2 callers
Function
WithNonBlocking
WithNonBlocking sets the pool to be non-blocking when the queue is full. This option is only effective when the queue size is set.
pooloptions.go:25
↓ 2 callers
Method
getResult
(count int)
internal/future/composite.go:143
↓ 2 callers
Function
invokeTask
(task any, panicRecovery bool)
task.go:58
↓ 2 callers
Function
newTaskGroup
(pool *pool, ctx context.Context)
group.go:205
↓ 2 callers
Method
notifyListeners
()
internal/future/composite.go:174
↓ 2 callers
Method
submit
(task any)
group.go:111
↓ 2 callers
Method
trySubmit
(task any)
pool.go:398
↓ 2 callers
Function
wrapTask
(task any, callback C, ctx context.Context, panicRecovery bool)
task.go:47
↓ 1 callers
Method
Context
()
pool.go:159
↓ 1 callers
Method
Done
()
internal/future/future.go:16
↓ 1 callers
Function
NewGroup
NewGroup creates a new task group with the default pool.
default.go:17
↓ 1 callers
Function
NewSubpool
NewSubpool creates a new subpool with the default pool.
default.go:22
↓ 1 callers
Function
PanicsWith
** * Asserts that the function panics with the expected object. */
internal/assert/assert.go:28
↓ 1 callers
Method
Stop
()
pool.go:519
↓ 1 callers
Function
SubmitErr
SubmitErr submits a task to the default pool and returns a future that can be used to wait for the task to complete.
default.go:12
↓ 1 callers
Function
WithoutPanicRecovery
WithoutPanicRecovery disables panic interception inside worker goroutines. When this option is enabled, panics inside tasks will propagate just like r
pooloptions.go:33
↓ 1 callers
Method
blockingTrySubmit
(task any)
pool.go:378
↓ 1 callers
Function
fetchURL
(ctx context.Context, url string)
examples/task_group/main.go:12
↓ 1 callers
Function
generateTasks
(count int, duration time.Duration)
examples/task_group_context/main.go:36
↓ 1 callers
Function
submitTasks
(pool pond.Pool)
examples/prometheus/main.go:82
↓ 1 callers
Method
subpoolWorker
(task any)
pool.go:279
↓ 1 callers
Method
worker
(task any)
pool.go:243
↓ 1 callers
Method
wrapTask
(task any)
pool.go:352
Method
CanceledTasks
()
pool.go:239
Method
CompletedTasks
()
pool.go:231
Method
Context
()
group.go:91
Method
Context
()
internal/future/composite.go:73
Method
Done
Returns a channel that is closed when all tasks in the group have completed, a task returns an error, or the group is stopped.
group.go:64
Method
Done
()
group.go:83
Method
Done
Done returns a channel that is closed when the task is complete or has failed.
future.go:17
Method
Done
Done returns a channel that is closed when the task is complete or has failed.
future.go:30
Method
Done
()
internal/future/value.go:17
Method
Done
(count int)
internal/future/composite.go:50
Method
DroppedTasks
()
pool.go:235
Method
Error
()
internal/future/value.go:57
Method
Error
()
internal/future/composite.go:21
Method
FailedTasks
()
pool.go:223
Method
Go
(task func())
pool.go:315
next →
1–100 of 262, ranked by callers