Skip to content

[Feature Request] ShellStream.Expect - Abort if No Match Found Within a Specified Timeout Period #365

@thecliguy

Description

@thecliguy

The ShellStream Expect method currently supports a timeout as follows:

public string Expect(Regex regex, TimeSpan timeout)

I believe that when standard output is detected, examining it is a synchronous operation. Consequently, if the standard output consists of thousands of lines then you have to wait for as long as it takes and there is no way to abort:

text = _encoding.GetString(_incoming.ToArray(), 0, _incoming.Count);

I am currently using Expect against a process which can potentially emit thousands of lines to standard output. What I would like is a way to abort Expect if no match is found within a specified period of time.

I am not a C# programmer but am more than happy to conduct some testing and build the project from source if anyone can suggest any changes to make this feature request possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions