Skip to content

How to detect submit_with_args timeout? #382

Description

@pauldoo

Hello,
When using submit_with_args and a timeout parameter, example like this:

let submitter: Submitter<'_> = ???;

let args = SubmitArgs::new().timespec(&(std::time::Duration::from_millis(100).into()));
let result = submitter.submit_with_args(1, &args);

What is the recommended approach for the application to determine that the timer expired?

What I observe is that the result comes back as Err(io::Error), with the "ErrorKind" set to "Uncategorized" (this variant is hidden from the docs). I can see the ETIME (62) result if I display the error as it shows Timer expired (os error 62). Clearly I don't want to be parsing the formatted error message, so I'm hoping you know a better way to check for expiry.

I could use io::Error::raw_os_error, but the type it returns is available only in nightly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions