Main Content

prodserver.addon.FevalFuture

R2026b

Function scheduled to run on MATLAB Production Server

Since R2026b

    Description

    An FevalFuture object represents a function that you have scheduled to run on MATLAB® Production Server™.

    Creation

    Create an FevalFuture object using the prodserver.addon.asyncfeval function.

    Properties

    expand all

    This property is read-only.

    Date and time when the FevalFuture object was created, returned as a datetime scalar.

    This property is read-only.

    Date and time at which the FevalFuture object was deleted from the server, returned as a datetime scalar.

    This property is read-only.

    Error information, returned as a scalar or cell array of MException objects. If the FevalFuture object completes with no error, this property is empty.

    This property is read-only.

    Date and time when the function finished, returned as a datetime scalar.

    The FevalFuture object finishes running when MATLAB finishes running the function associated with it.

    If the function associated with the FevalFuture object is not finished running, this property is an empty datetime array.

    This property is read-only.

    Function associated with the FevalFuture object, returned as a string scalar.

    Host name of the MATLAB Production Server instance hosting the deployable archive that created the FevalFuture object, returned as a string scalar or character vector.

    Example: "144.213.5.7"

    This property is read-only.

    Identifier, returned as an integer scalar.

    Data Types: double

    This property is read-only.

    Input arguments for the function, returned as a cell array.

    When the scheduled function specified by the Function property runs, it runs as fcn(X{:}), where X is the cell array of input arguments specified by this property.

    Example: {[1]}

    Example: {[1,2], "string data", 13.2}

    This property is read-only.

    Number of arguments requested from the function, returned as an integer scalar.

    The function specified by the Function property must return at least as many arguments as returned by this property.

    Data Types: double

    This property is read-only.

    Duration of the function ran on the server, returned as a duration scalar.

    The duration is calculated by subtracting CreateDateTime from now or DeleteDateTime.

    This property is read-only.

    Output arguments from running the function, returned as a cell array.

    This property is an empty cell array if the FevalFuture object is not finished running or the associated function finishes execution with an error. It becomes non-empty when you successfully run fetchOutputs on the FevalFuture object. The results are stored locally and fetchOutputs deletes the results from the server. Subsequent calls to fetchOutputs access this property rather than retrieving them from the server again.

    Example: {[3.14]}

    Data Types: cell

    Port number of the MATLAB Production Server instance hosting the deployable archive that created the FevalFuture object, returned as a positive scalar.

    Example: 9920

    Data Types: uint8 | uint16

    Protocol used to make the request to MATLAB Production Server, returned as "HTTP" or "HTTPS".

    Full URL of the request to MATLAB Production Server, returned as a string scalar in the form <protocol>://<host>:<port>/<path to request>.

    Value of the Session-ID header from the server, if one exists, returned as a string scalar.

    This property is read-only.

    Current state of the future, returned as one of these members of the AsyncState enumeration:

    • 'Reading' — FevalFuture is being read by MATLAB Production Server and is not yet in the queue.

    • 'inQueue' — FevalFuture is queued, and the function associated with it is scheduled to run.

    • 'Processing' — Function associated with the FevalFuture is currently running.

    • 'Ready' — Function associated with the FevalFuture is finished running.

    • 'Error' — Function associated with the FevalFuture has produced an error.

    • 'Cancelled' — Evaluation of the function associated with the FevalFuture has been cancelled.

    • 'Deleted' — The FevalFuture has been deleted.

    • 'Unknown' — Function associated with the FevalFuture is in an unknown state.

    This property is read-only.

    List of terminal states, returned as one of these members of the AsyncState enumeration:

    • 'Ready' — Function associated with the FevalFuture is finished running.

    • 'Error' — Function associated with the FevalFuture has produced an error.

    • 'Cancelled' — Evaluation of the function associated with the FevalFuture has been cancelled.

    Object Functions

    expand all

    cancelStop function running on MATLAB Production Server in the background
    fetchOutputsRetrieve results from function running on MATLAB Production Server in the background
    waitWait for futures running on MATLAB Production Server to complete

    Version History

    Introduced in R2026b