Open Closed

How to create task queue and access the queue methods #10794


0
shedspotter created

What is your product version? 10.3.0

What is your product type (Angular or MVC)? Angular

What is product framework type (.net framework or .net core)? .NET 5

Hi I want to create a task queue in my project and how can add a listner as well in that so that the queued methods will execute and update the client site as well/ Please help me with that issue.

Thanks


3 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi,

    To inform clint from a Task, you can use SignalR, see https://aspnetboilerplate.com/Pages/Documents/SignalR-Integration.

    AspNet Zero doesn't provide such a Task mechanism. Could you explain your use-case in detail. We may offer you a solution.

    Thanks,

  • 0
    shedspotter created

    Hi ismcagdas, Thanks for the response. SingalR basically work for the live update to the client site. In our case we have one method which creates new item but inside that method we are colling some other methods which do some other task like sending data to 3rd party app, updating the DB etc becuase of that the response for getting new item id is taking time due to which it is tasking time in reflecting client site as well and also we can not remove thses method and also all the methods does not return data as well. for example : Parent method 1. child mehtod 2. child mehtod 3. child mehtod 4. child mehtod 5. child mehtod

    return parent mehtod
    so we want child method should be run in background and parent method return the result without waiting for child methods

    Thanks

  • 0
    musa.demir created
    Support Team

    Hi shedspotter

    If your child methods must be completed to complete your main method, you should do all logic in a backgroundjobs then show user what is the current progress. Otherwise if your main method does not depend on it, you may return your parent method and just create a backgroundjobs for child methods. See: https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers