Async canvas

Hi!
Recently i forked this repo:

It did not work for me, so i asked ai to adapt it so it works on mac. I do not recommend using it for big/important projects - its buggy and may crash rhino. but check it out, its pretty fun.
I am curious if it works on windows. Maybe someone wants to finish the project, that would be huge.

Async Test-MultiTask.gh (9.6 KB)

Async Test-Continue.gh (3.9 KB)

Basically it allows to save definition, cancel computation, and rearrange components while components are still processing.
It feels so nice for huge kangaroo projects :slightly_smiling_face:

Its nice but I would not recommend to install a “patch” library of unknown source. 0Harmony.dll is probably from the Harmony project. But who knows…

there is actually no need for it, since you can also replace default functions using:

    public static class Patch
    {
        public static void Install(string targetMethodName, string replaceMethodName, Type targetType,Type injectorType, Type[] signature)
        {
            MethodInfo methodToReplace = null;
            if (signature != null)
                methodToReplace = targetType.GetMethod(targetMethodName,
                BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, Type.DefaultBinder, signature, null);
            else
                methodToReplace = targetType.GetMethod(targetMethodName,
                BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);

            MethodInfo methodToInject = injectorType.GetMethod(replaceMethodName,
                BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);

            RuntimeHelpers.PrepareMethod(methodToReplace.MethodHandle);
            RuntimeHelpers.PrepareMethod(methodToInject.MethodHandle);

            unsafe
            {

                if (IntPtr.Size == 4)
                {
                    int* inj = (int*)methodToInject.MethodHandle.Value.ToPointer() + 2;
                    int* tar = (int*)methodToReplace.MethodHandle.Value.ToPointer() + 2;
#if DEBUG
                    //Console.WriteLine("\nVersion x86 Debug\n");

                    byte* injInst = (byte*)*inj;
                    byte* tarInst = (byte*)*tar;

                    int* injSrc = (int*)(injInst + 1);
                    int* tarSrc = (int*)(tarInst + 1);

                    *tarSrc = (((int)injInst + 5) + *injSrc) - ((int)tarInst + 5);
#else
                    //Console.WriteLine("\nVersion x86 Release\n");
                    *tar = *inj;
#endif
                }
                else
                {

                    long* inj = (long*)methodToInject.MethodHandle.Value.ToPointer() + 1;
                    long* tar = (long*)methodToReplace.MethodHandle.Value.ToPointer() + 1;
#if DEBUG
                    //Console.WriteLine("\nVersion x64 Debug\n");
                    byte* injInst = (byte*)*inj;
                    byte* tarInst = (byte*)*tar;


                    int* injSrc = (int*)(injInst + 1);
                    int* tarSrc = (int*)(tarInst + 1);

                    *tarSrc = (((int)injInst + 5) + *injSrc) - ((int)tarInst + 5);
#else
                    //Console.WriteLine("\nVersion x64 Release\n");
                    *tar = *inj;
#endif
                }
            }
        }

You do not need this dll at all, it was used in the original async, it is not used in this version

nice and thanks for sharing.

Next week i will be running a heavy compute task, so looking forward to give this a test (windows). Keep you posted .
ps: 2 small typo’s in about description, should be “.. unresponsive in solution state.”

Yeah XD Original author is chinese, i think he used translator, and my description is just :smiley:

some first feedback, works like a charme, i like it a lot !

only issue i’ve noticed thus far is with Bitmap+ plugin, that when async is enabled has issues when input data changes as some ‘compute intense’ nodes like BmpProperties of DeconstructBitmap fail with a notice like ‘Solution exception:Object is currently in use elsewhere.’ or in this example when you recompute. WHen i disable the Async toggle button and recompute these nodes do pass data

Edit: i did had to install Rhino RC given you build it with latest SDK, and I have some issues with Rhino crashing and the UI not responsive, where i cannot make new layers or toggle them on/off when loading a gh file. When I uninstall the plugin, Rhino acts like normal. am using (8.31.26104.8181, 2026-04-14). Cannot check with a stable rhino version as then i cannot install the plugin

Thanks for the feedback! Yeah, i noticed the first issue too. Some nodes have to be recomputed, and then they start working.

Interesting bug with rhino ui and layers.

Main issue for me is that in many instances rhino was crashing.. Right now i do not have time to invest in this plug in, hopefully someone can work on that