Skip to content

Each scenario on a new thread. #286

Answered by ilslv
zie1ony asked this question in Q&A
May 25, 2023 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

@zie1ony as I said earlier, to give users maximum flexibility, I would prefer to keep event::Step: !Sync, which makes it impossible to pass value to another thread. I would suggest implementing your own stricter version of event::Step, which will look something like:

#[derive(Debug)]
pub enum SyncStep<World> {
    Started,
    Skipped,
    Passed(regex::CaptureLocations, Option<step::Location>),
    Failed(
        Option<regex::CaptureLocations>,
        Option<step::Location>,
        Option<Arc<World>>,
        StepError,
    ),
}

#[derive(Clone, Debug, Display, Error, From)]
pub enum SyncStepError {
    #[display(fmt = "Step doesn't match any function")]
    NotFound,
    #[display(f…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@zie1ony
Comment options

@ilslv
Comment options

@zie1ony
Comment options

@ilslv
Comment options

Answer selected by zie1ony
@zie1ony
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants