Am 2. Okt 2004 um 08:11 schrieb Christian Miller:
On Oct 2, 2004, at 2:07 AM, Christian Miller wrote:
I'm working on an application in which I would like to have multiple
HTTP queries going on at the same time. I made a class which
inherits from the thread class. In my class' "Run" event, I have:
sPage = TheSocket.Get(m_sURL)
My issue is, how can I have this class "raise" an event (VB
terminology) back to the code that instantiated the thread class?
When I did something similar in VB, I instantiated a socket, sent the
query, and added the socket to a collection. Then i would pull out
each item of the collection and examine the socket's state. I'd like
to avoid doing that same thing if possible. Any ideas?
I don't like responding to my own messages, but don't think I
clarified myself. Basically, once the page has been retrieved, I'd
like the thread to say "here is the page" so that the class that
created the thread can then parse the page.
I've implemented a small producer / consumer pattern.
Objects can register as consumers for special events.
They then get notfied, when such an event occurs. To
be a consumer, the class has to implemente the consumer
interface.
Other objects can forward notifications to the
producer/consumer manager. The manager decides, who
has to receive a message.
The pattern allows to have anonymous producer / consumer
connections, since events are forwarded based on
subscribed event patterns.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|