Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
6d0e136b
Commit
6d0e136b
authored
5 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Concurrent.Future: Added query_{success,failure}_callbacks().
parent
2286e78f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Concurrent.pmod
+26
-2
26 additions, 2 deletions
lib/modules/Concurrent.pmod
with
26 additions
and
2 deletions
lib/modules/Concurrent.pmod
+
26
−
2
View file @
6d0e136b
...
@@ -207,7 +207,7 @@ class Future
...
@@ -207,7 +207,7 @@ class Future
//! @[cb] will always be called from the main backend.
//! @[cb] will always be called from the main backend.
//!
//!
//! @seealso
//! @seealso
//! @[on_failure()]
//! @[on_failure()]
, @[query_success_callbacks()]
this_program on_success(function(mixed, mixed ... : void) cb, mixed ... extra)
this_program on_success(function(mixed, mixed ... : void) cb, mixed ... extra)
{
{
switch (state) {
switch (state) {
...
@@ -223,6 +223,18 @@ class Future
...
@@ -223,6 +223,18 @@ class Future
return this_program::this;
return this_program::this;
}
}
//! Query the set of active success callbacks.
//!
//! @returns
//! Returns an array with callback functions.
//!
//! @seealso
//! @[on_success()], @[query_failure_callbacks()]
array(function) query_success_callbacks()
{
return column(success_cbs, 0);
}
//! Register a callback that is to be called on failure.
//! Register a callback that is to be called on failure.
//!
//!
//! @param cb
//! @param cb
...
@@ -237,7 +249,7 @@ class Future
...
@@ -237,7 +249,7 @@ class Future
//! @[cb] will always be called from the main backend.
//! @[cb] will always be called from the main backend.
//!
//!
//! @seealso
//! @seealso
//! @[on_success()]
//! @[on_success()]
, @[query_failure_callbacks()]
this_program on_failure(function(mixed, mixed ... : void) cb, mixed ... extra)
this_program on_failure(function(mixed, mixed ... : void) cb, mixed ... extra)
{
{
switch (state) {
switch (state) {
...
@@ -256,6 +268,18 @@ class Future
...
@@ -256,6 +268,18 @@ class Future
return this_program::this;
return this_program::this;
}
}
//! Query the set of active failure callbacks.
//!
//! @returns
//! Returns an array with callback functions.
//!
//! @seealso
//! @[on_failure()], @[query_success_callbacks()]
array(function) query_failure_callbacks()
{
return column(failure_cbs, 0);
}
//! Apply @[fun] with @[val] followed by the contents of @[ctx],
//! Apply @[fun] with @[val] followed by the contents of @[ctx],
//! and update @[p] with the result.
//! and update @[p] with the result.
protected void apply(mixed val, Promise p,
protected void apply(mixed val, Promise p,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment