ReturnEvent

public class ReturnEvent : CommunicationEvent<ReturnEventData>

ReturnEvent provides a generic implementation for responding to a CallEvent.

Static Factory Methods.

  • Create a ReturnEvent instance for a remote operation call that successfully yields a result.

    Declaration

    Swift

    public static func with(result: AnyCodable, executionInfo: ExecutionInfo?) -> ReturnEvent

    Parameters

    result

    the result value to be returned (any JSON data type)

    executionInfo

    information about the execution of the operation (optional)

    Return Value

    a Return event with the given parameters

  • Create a ReturnEvent instance for a remote operation call that yields an error.

    The error code given is an integer that indicates the error type that occurred, either a predefined error or an application defined one. Predefined error codes are defined by the RemoteCallErrorCode enum. Predefined error codes are within the range -32768 to -32000. Application defined error codes must be defined outside this range.

    The error message provides a short description of the error. Predefined error messages exist for all predefined error codes (see enum RemoteCallErrorMessage).

    Declaration

    Swift

    public static func with(error: ReturnError, executionInfo: ExecutionInfo?) -> ReturnEvent

    Parameters

    error

    The error including the code that indicates the error type and the message string providing a short description of the error.

    executionInfo

    information about the execution of the operation (optional)

    Return Value

    a Return event with the given parameters

Codable methods.

  • Undocumented

    Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Undocumented

    Declaration

    Swift

    override public func encode(to encoder: Encoder) throws