diff --git a/lib/modules/Concurrent.pmod b/lib/modules/Concurrent.pmod index dfd4b9526396797ceaeba84185dbf9fec51d7361..a78730beb99a648c3dd089503fdb2dfff9aefc30 100644 --- a/lib/modules/Concurrent.pmod +++ b/lib/modules/Concurrent.pmod @@ -207,7 +207,7 @@ class Future //! @[cb] will always be called from the main backend. //! //! @seealso - //! @[on_failure()] + //! @[on_failure()], @[query_success_callbacks()] this_program on_success(function(mixed, mixed ... : void) cb, mixed ... extra) { switch (state) { @@ -223,6 +223,18 @@ class Future 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. //! //! @param cb @@ -237,7 +249,7 @@ class Future //! @[cb] will always be called from the main backend. //! //! @seealso - //! @[on_success()] + //! @[on_success()], @[query_failure_callbacks()] this_program on_failure(function(mixed, mixed ... : void) cb, mixed ... extra) { switch (state) { @@ -256,6 +268,18 @@ class Future 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], //! and update @[p] with the result. protected void apply(mixed val, Promise p,