I have a 3rd-party protocol module (SNMP) that is built on top of asyncore. The asyncore interface is used to process response messages. What is the proper technique to design a client that generate the request-side of the protocol, while the asyncore main loop is running. I can think of two options right now:

Use the loop,timeout parameters of asyncore.loop() to allow my client program time to send the appropriate request.
Create a client asyncore dispatcher that will be executed in the same asyncore processing loop as the receiver.

What is the best option? I'm working on the 2nd solution, cause the protocol API does not give me direct access to the asyncore parameters. Please correct me if I've misunderstood the proper technique for utilizing asyncore.
I solved this by adding a callback function into the asyncore loop for the receiver process.
The solution was somewhat specific to the module I was experiment with (pySNMP), but here is the general idea:

define a function closure that returns a callable method with a stored reference to a dict and window variable. The dict tracks the expected responses, and the window is the size of the sender buffer.
pass a reference to the closure function into a customized asyncore.dispatcher instance. The callback function can be executed in the writeable method invocation.
set the timeout of the dispatcher to a small value. This prevents asyncore from blocking for too long, while waiting for received packets. I used .05 seconds. The lower you go, the more response your app is, but don't go too low.
update the asyncore read_handle method to remove the received responses from your global dict structure. This will allow new messages to be transmitted.
now kick-off the dispatcher and every loop of the asyncore, the system will call the callback function, and send any messages, up to the defined window size.
Building an SNMP Request-Response service with Python Asyncore