Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spells): Allow parallel execution of immut service functions [NET-331] #1430

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

kmd-fl
Copy link
Contributor

@kmd-fl kmd-fl commented Jan 25, 2023

Tested: run 10 parallel spell.installs, and they worked fine, all spells were created quite fast.

@kmd-fl kmd-fl requested a review from folex January 25, 2023 14:21
@linear
Copy link

linear bot commented Jan 25, 2023

NET-331 Allow parallel execution of the same spell builtin function

Right now we take a lock before function execution, so the same function can't be executed simultaneously.

particle-builtin/src/builins.rs:149 :

    if let Some(function) = self
        .custom_services
        .read()
        .get(&args.service_id)
        .and_then(|fs| {
            fs.functions
                .get(&args.function_name)
                .or(fs.unhandled.as_ref())
        })
    {
        let mut function = function.lock();
        async_std::task::block_on(function(args, particle))
    } else {

@kmd-fl kmd-fl changed the title Allow parallel execution of immut service functions [NET-331] fix(spells): Allow parallel execution of immut service functions [NET-331] Jan 25, 2023
@folex folex requested a review from gurinderu January 25, 2023 15:02
@kmd-fl kmd-fl enabled auto-merge (squash) January 26, 2023 11:55
@kmd-fl kmd-fl merged commit e9a05d6 into master Jan 26, 2023
@kmd-fl kmd-fl deleted the fix-spell-builtins branch January 26, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants