473,320 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can this be done?

I have the following situation:

1. Need to create a windows service that can pick up files to process and
hand off the work to a 'Processor' hosted in COM+, this should be
asynchronous, the service will retain a handle (for want of a better word) to
the processor.

2. The 'Processor' will report back to the windows service that gave it the
work during the processing to inform it how the processing is going on.

I have no problem in creating the service or the processor, its just the
communication between them where I have questions.

I understand that I could create a delegate to handle the whole
processor-work functionality. As I understand it the delegate thread is in
the same thread pool as the main process and obviously the more threads in
the pool working the slower the main process will be.

Looking at MSDN the IAsyncResult seems to provide me with a way for the
Processor to report that its finished its work but I need on going
communication between the 2 with the Processor passing information back to
the service which it will in turn use for updating a database. Before .Net I
would have created a callback and have part of the information passed back
indicate the state e.g. data or finished which would allow the service to
decided what to do with the message.

I'm short on time and long on requirements, does anybody know if what I can
do what I need or do I need to change the architecture?
Nov 17 '05 #1
4 924
Nathan,

I don't know that I would try to perform a callback from within COM+.
It just doesn't seem natural, to be honest.

What I would do is have the processor send a message over MSMQ, or use
COM+ events to fire an event that you can subscribe to. If you use MSMQ,
then your service will have to listen on the queue for messages, and perform
the processing when it receives it. If you use COM+ events, you don't even
have to write anything in your service. Instead, you can create a component
that will be created and called when the event is fired.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
I have the following situation:

1. Need to create a windows service that can pick up files to process and
hand off the work to a 'Processor' hosted in COM+, this should be
asynchronous, the service will retain a handle (for want of a better word)
to
the processor.

2. The 'Processor' will report back to the windows service that gave it
the
work during the processing to inform it how the processing is going on.

I have no problem in creating the service or the processor, its just the
communication between them where I have questions.

I understand that I could create a delegate to handle the whole
processor-work functionality. As I understand it the delegate thread is in
the same thread pool as the main process and obviously the more threads in
the pool working the slower the main process will be.

Looking at MSDN the IAsyncResult seems to provide me with a way for the
Processor to report that its finished its work but I need on going
communication between the 2 with the Processor passing information back to
the service which it will in turn use for updating a database. Before
.Net I
would have created a callback and have part of the information passed back
indicate the state e.g. data or finished which would allow the service to
decided what to do with the message.

I'm short on time and long on requirements, does anybody know if what I
can
do what I need or do I need to change the architecture?

Nov 17 '05 #2
Thanks for that Nicholas, hadn't really considered COM+ Events company I work
for saw them as 'too complex' and had written them off, much the same as MSMQ.

The only question I have is if I use COM+ events which will allow the
processor to communicate with the service can I also use them for the service
sending messages to the processor for example abort processing? or would I
have to look at using both COM+ events and MSMQ to achieve this?

Thanks

"Nicholas Paldino [.NET/C# MVP]" wrote:
Nathan,

I don't know that I would try to perform a callback from within COM+.
It just doesn't seem natural, to be honest.

What I would do is have the processor send a message over MSMQ, or use
COM+ events to fire an event that you can subscribe to. If you use MSMQ,
then your service will have to listen on the queue for messages, and perform
the processing when it receives it. If you use COM+ events, you don't even
have to write anything in your service. Instead, you can create a component
that will be created and called when the event is fired.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
I have the following situation:

1. Need to create a windows service that can pick up files to process and
hand off the work to a 'Processor' hosted in COM+, this should be
asynchronous, the service will retain a handle (for want of a better word)
to
the processor.

2. The 'Processor' will report back to the windows service that gave it
the
work during the processing to inform it how the processing is going on.

I have no problem in creating the service or the processor, its just the
communication between them where I have questions.

I understand that I could create a delegate to handle the whole
processor-work functionality. As I understand it the delegate thread is in
the same thread pool as the main process and obviously the more threads in
the pool working the slower the main process will be.

Looking at MSDN the IAsyncResult seems to provide me with a way for the
Processor to report that its finished its work but I need on going
communication between the 2 with the Processor passing information back to
the service which it will in turn use for updating a database. Before
.Net I
would have created a callback and have part of the information passed back
indicate the state e.g. data or finished which would allow the service to
decided what to do with the message.

I'm short on time and long on requirements, does anybody know if what I
can
do what I need or do I need to change the architecture?


Nov 17 '05 #3
Nathan,

If you use COM+ events, then you can go one of two ways.

If the event doesn't require any specific information from the service,
you can have the COM+ event create a new instance of the handler, and then
the handler will just perform the action that it needs to perform. Or, you
can actually register a class in your application to be the handler, while
your application is active.

If you want to send a notification to the processor in COM+, it's just
like calling a method. You just have a method which causes the processing
to stop.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
Thanks for that Nicholas, hadn't really considered COM+ Events company I
work
for saw them as 'too complex' and had written them off, much the same as
MSMQ.

The only question I have is if I use COM+ events which will allow the
processor to communicate with the service can I also use them for the
service
sending messages to the processor for example abort processing? or would
I
have to look at using both COM+ events and MSMQ to achieve this?

Thanks

"Nicholas Paldino [.NET/C# MVP]" wrote:
Nathan,

I don't know that I would try to perform a callback from within COM+.
It just doesn't seem natural, to be honest.

What I would do is have the processor send a message over MSMQ, or
use
COM+ events to fire an event that you can subscribe to. If you use MSMQ,
then your service will have to listen on the queue for messages, and
perform
the processing when it receives it. If you use COM+ events, you don't
even
have to write anything in your service. Instead, you can create a
component
that will be created and called when the event is fired.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
>I have the following situation:
>
> 1. Need to create a windows service that can pick up files to process
> and
> hand off the work to a 'Processor' hosted in COM+, this should be
> asynchronous, the service will retain a handle (for want of a better
> word)
> to
> the processor.
>
> 2. The 'Processor' will report back to the windows service that gave it
> the
> work during the processing to inform it how the processing is going on.
>
> I have no problem in creating the service or the processor, its just
> the
> communication between them where I have questions.
>
> I understand that I could create a delegate to handle the whole
> processor-work functionality. As I understand it the delegate thread is
> in
> the same thread pool as the main process and obviously the more threads
> in
> the pool working the slower the main process will be.
>
> Looking at MSDN the IAsyncResult seems to provide me with a way for the
> Processor to report that its finished its work but I need on going
> communication between the 2 with the Processor passing information back
> to
> the service which it will in turn use for updating a database. Before
> .Net I
> would have created a callback and have part of the information passed
> back
> indicate the state e.g. data or finished which would allow the service
> to
> decided what to do with the message.
>
> I'm short on time and long on requirements, does anybody know if what I
> can
> do what I need or do I need to change the architecture?


Nov 17 '05 #4
Thanks for that Nicholas, I will investigate further.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Nathan,

If you use COM+ events, then you can go one of two ways.

If the event doesn't require any specific information from the service,
you can have the COM+ event create a new instance of the handler, and then
the handler will just perform the action that it needs to perform. Or, you
can actually register a class in your application to be the handler, while
your application is active.

If you want to send a notification to the processor in COM+, it's just
like calling a method. You just have a method which causes the processing
to stop.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
Thanks for that Nicholas, hadn't really considered COM+ Events company I
work
for saw them as 'too complex' and had written them off, much the same as
MSMQ.

The only question I have is if I use COM+ events which will allow the
processor to communicate with the service can I also use them for the
service
sending messages to the processor for example abort processing? or would
I
have to look at using both COM+ events and MSMQ to achieve this?

Thanks

"Nicholas Paldino [.NET/C# MVP]" wrote:
Nathan,

I don't know that I would try to perform a callback from within COM+.
It just doesn't seem natural, to be honest.

What I would do is have the processor send a message over MSMQ, or
use
COM+ events to fire an event that you can subscribe to. If you use MSMQ,
then your service will have to listen on the queue for messages, and
perform
the processing when it receives it. If you use COM+ events, you don't
even
have to write anything in your service. Instead, you can create a
component
that will be created and called when the event is fired.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan" <Na****@discussions.microsoft.com> wrote in message
news:3F**********************************@microsof t.com...
>I have the following situation:
>
> 1. Need to create a windows service that can pick up files to process
> and
> hand off the work to a 'Processor' hosted in COM+, this should be
> asynchronous, the service will retain a handle (for want of a better
> word)
> to
> the processor.
>
> 2. The 'Processor' will report back to the windows service that gave it
> the
> work during the processing to inform it how the processing is going on.
>
> I have no problem in creating the service or the processor, its just
> the
> communication between them where I have questions.
>
> I understand that I could create a delegate to handle the whole
> processor-work functionality. As I understand it the delegate thread is
> in
> the same thread pool as the main process and obviously the more threads
> in
> the pool working the slower the main process will be.
>
> Looking at MSDN the IAsyncResult seems to provide me with a way for the
> Processor to report that its finished its work but I need on going
> communication between the 2 with the Processor passing information back
> to
> the service which it will in turn use for updating a database. Before
> .Net I
> would have created a callback and have part of the information passed
> back
> indicate the state e.g. data or finished which would allow the service
> to
> decided what to do with the message.
>
> I'm short on time and long on requirements, does anybody know if what I
> can
> do what I need or do I need to change the architecture?


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: itsharkopath | last post by:
Hi, Imagine a user in a hotspot, when he comes to the hotspot and tries to load a webpage (on the internet), he would automatically redirected to login page. I believe the following is to be...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
16
by: jaialai technology | last post by:
I want to reload a url in a browser window so I do something like this: open(window.location.href= "www.yahoo.com"); ok, so now I want to do something when that page is done loading completely....
5
by: Morten Overgaard | last post by:
Hi I have a C# component which fires events. I want to catch these events in my MFC app compiled with the /clr. I know I can define a managed class in my MFC app which traps the events - but I...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
3
by: Miguel Dias Moura | last post by:
Hi, When I subscribe a web site I usually receive an email to confirm my subscription. Only after I follow the link in the email my account gets activated. In general, how is this done? Can...
4
by: BrianDH | last post by:
Group Early this week I ask for examples on how to call a VB.NET Web Service and access its DataSet for a traditional ASP page. I was told, "you can't", "won't work", "not possible". Well I...
12
by: Ark | last post by:
Hello NG, I arrange data in structs like { members... uint16_t crc; more members, maybe... } Then I need to save them, up to and including crc, in non-volatile memory or a file, as the case...
2
by: maya | last post by:
http://news.yahoo.com/news?tmpl=index2&cid=703 down the page, under "More Stories", there's a section with two interchangeable divs which slide back and forth into view.. how is this done? I...
2
by: poolboi | last post by:
hey guys, i've done most of my web app. for searching almost done but then i got a small little problem with logging in i need to know how session tracking is done in perl if not my log in page...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.