Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sorry, but since C# 2.0 we could just write "new Thread(DoStruff)" or "SomeDelegate del = SomeMethod".


I can't resist, so,

    public static class ActionExtensions
    {
        public static void InvokeAsync(this Action<object> target, object context)
        {
            new Thread(obj => target(obj)).Start(context);
        }
    }

     ((Action<object>) (Console.WriteLine)).InvokeAsync("Hello, World");




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: