Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 321281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:49:52+00:00 2026-05-12T08:49:52+00:00

How can I implement background processing queues in my ASP.NET MVC web app? While

  • 0

How can I implement background processing queues in my ASP.NET MVC web app? While most data changes, updates etc. need to be visible immediately, there are other updates that don’t need real time processing which I would like to hand off to a lower-priority background process which will take care of it at its own pace.

As an example, take StackOverflow’s badge award system. Usually you may take a specific action that would award you a badge, but the actual ‘award’ happens later (typically between 10 minutes and a couple hours later). I assume this is done via a separate background process as it is not critical for SO’s workings to award badges immediately when earned.

So, I’m trying to create some kind of queue system in which I could stuff tasks (say anything implementing ITask interface which will have a Process() method) which will eventually get executed by a separate process.

How would I go about implementing such a system? Ideas/Hint/Sample Code?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:49:53+00:00Added an answer on May 12, 2026 at 8:49 am

    Windows Services and MSMQ to communicate with them (if you even need to).

    — Edit

    To slightly expand.

    You’ll create several services, depending on what you want to do, and have them all run an endless thread of various sleeping levels, to do what you want. They will then update the database appropriately, and you will not have had to do anything on the client side.

    You may wish to interact with them from an admin point of view, hence you may have an MSMQ that they listen to admin commands on. Depending on your implementation, you may need to restart them for some reason, or possibly just ‘force’ a running of whatever they wish to do.

    So you’ll use an MSMQ Private Queue to do it (System.Messaging namespace). One of the main things to note about MSMQ, is that message need to be < 4meg. So if you intend to send large object graphs, serialise to a file first and just send the filename.

    MSMQ is quite beautiful. You can send based on a ‘Correlation ID’ if you need to, but, for some amusing reason, the correlation ID must be in the form of:

    {guid}\1
    

    Anything else does not work (at least in version 2.0 of the framework, the code may have changed).

    — Edit

    Example, as requested:

    using System.Messaging;
    
    ...
    
    
    MessageQueue queue = new MessageQueue(".\\Private$\\yourqueue");
    queue.Formatter = new BinaryMessageFormatter();
    
    Message m = new Message();
    m.Body = "your serialisable object or just plain string";
    
    queue.Send(m);
    
    
    // on the other side
    
    MessageQueue queue = new MessageQueue(".\\Private$\\yourqueue");
    queue.Formatter = new BinaryMessageFormatter();
    
    Message m = queue.Receive();
    
    string s = m.Body as string;
    
    // s contains that string now
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 185k
  • Answers 185k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, using &quot; works: <input type="text" name="last_name" value="&quot;My quote!&quot;" /> May 12, 2026 at 4:57 pm
  • Editorial Team
    Editorial Team added an answer Unfortunately you can't do this. Although the Assembly class itself… May 12, 2026 at 4:57 pm
  • Editorial Team
    Editorial Team added an answer In general, when you have a many-to-many relationship in your… May 12, 2026 at 4:57 pm

Related Questions

I am building a website in CakePHP that processes files uploaded though an XML-RPC
I implemented the following background processing thread, where Jobs is a Queue<T> : static
I have a problem drawing something quickly in .NET. I don't think that any
ReSharper has a nice feature called extend selection: by pressing CTRL+W (I think this

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.