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

  • SEARCH
  • Home
  • 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 8702995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:47:00+00:00 2026-06-13T02:47:00+00:00

I am working on some software that is making calculations on the server side.

  • 0

I am working on some software that is making calculations on the server side. I have tried using BackgroundWorker and it was working perfectly fine until I tried switching from fat client to a web service. The error (which I was already expecting due to what my colleagues told me) “BackgroundWorker is not marked as Serializable” occured. The goal of my application is to update the client with the progress of the calculation as well as the name of the record currently being calculated. If needed I can post some code, but in this case I doubt it is really relevant to the problem. The scheme of what I am trying to achieve could be shown like this:

  • Client hits button “prepare”
  • Server gets the call
  • Server sends the data
  • Client receives the records list to confirm
  • Client confirms their choice (I then set up the background worker and send it to the server)
  • Server gets the call (receives the background worker’s reference, as well as all the records needed to calculate at once)
  • With a loop I run through the records (each calculation takes ~1-3 seconds), update BackgroundWorker’s status like this:

    worker.ReportProgress(i * 100 / ids.Length, "Currently counting: " + id + "...");
    Calculate(ids[i]);
    worker.ReportProgress((i+1) * 100 / ids.Length, "Currently counting: " + id + "...");
    

Is there any way to achieve what I am trying to to work also on the web service too?
I assume it would require either tricking BackgroundWorker into Serializable or maybe there are other ways to update the status from the server to the client?

P.S. I am not sending very much data back from the server (I could actually even try to send even less data like id only), so I assume that won’t be a problem of the overload.

  • 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-06-13T02:47:00+00:00Added an answer on June 13, 2026 at 2:47 am

    Basically when you’re writing code for the web, you’re dealing with an entirely different model, based on request/response rather than continual interaction.

    You should probably make your initial request return a sort of “task ID” (which can be any unique ID), and return that quickly. Meanwhile, you start the task in the background. The client can then poll for the status of that particular task. You could use “long polling” where each request hangs around until there’s a change in status, or just make the client call the server regularly. Either way, the response will just be the progress (the number of records processed and the name of the current record).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using some software that requires me to have thread safety disabled. I
I have some PHP code that was at one point WORKING FINE. It makes
I'm working on some software to manage a device that communicates with a remote
I'm working on a Qt based software that involves some cryptography. The only three
I'm working on a script that is supposed to install some software from a
I'm working on a plugin for Avogadro (chemistry software) that uses pyqt. I've some
I'm working some code that inserts csv rows into an SQLite database using Python.
I'm working on a plugin for some software that I'm planning on selling someday.
I am working on some software that does a sparse matrix-vector multiply. The matrix
I am working on some software that should be used for a special type

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.