Queueing in Client Server Application

A

asadikhan

Hi,

I have a client server application where the client sends a request to
the server with a filename. The server needs to read the file
contents, massage the data, and then add it to the database. However,
if two requests show up at the same time, I need to create some sort
of a waiting mechanism or queue.

I was thinking about using a Singleton Server Activation object for
this reason, but I am not sure how I can implement the queueing
mechanism. As far as I know, once the server method is done adding the
file contents to the database, it will return true/false. But I need
it to pick up any pending files in the queue and process them as well.
At the same time, I don't want the first client request to wait until
all the files in the queue are processed.

The client also is waiting for a success/failure bool from the server
side method.

Any ideas on how I can accomplish this?

Asad
 
G

Guest

Why do you need a waiting mechanism? You could certainly use a Queue object
to hold the requests and process them serially. But you could also use
QueueUserWorkItem onto the Threadpool with a specified callback and have them
all processed on threadpool threads in parallel.
Peter
 
R

Robson Siqueira

Asad,

Since you don't specify too much of your current architecture, there are
some questions that would change the way you could do things.

a) do your client needs to wait for an answer or result?
b) does the server need to process the requests are they are sent or could
this be done from times to times?
c) are the files located on the server?
d) are clients/server running on the same physical network or do you have
the ability to have clients outside your network (like internet)?

With these answers, I think I could be of more help.
 
A

asadikhan

a) Yes, the client is waiting for a success/failure response from the
server.
b) The server must respond and work on the request immediately and
return the result.
c) No the files are located on a seperate server. The client
application will be on the workstations spread out across the company.
The server application will be running on a SQL server machine. And
the files are physically located on a third server machine we have.
d) No internet. Everything is on the same network.

Asad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top