I am writing a qpsmtpd-async plugin to send various blocking operation commands to a group of pre-forked (at startup time) handler processes.
1.) For purposes of description plugin1 is called: handlerProcess plugin2 is called: rcpt_ok 2.) rcpt_ok at init performs a self->isa_plugin(handlerProcess) 3.) handlerProcess has a global hash of pre-forked handler processes, this is populated at the first call to hook_connect (the first time hook_connect is called from startup, and only this time) 4.) rcpt_ok has a hook_rcpt that calls $self->doQuery(), sub doQuery resides in handlerProcess plugin and this function adds a command to a global array of pending commands, then it performs a handlerObject- >watch_write(1) so that the queue is picked up by Danga::Socket 5.) rcpt_ok returns YIELD 6.) My problem is that in event_write and event_read() i lose access to the plugin object, if i use Dumper to dump it out I get an empty object even though I have passsed the $self object into a global array. When I run run_continuation I receive an error. I suspect I should not be using global variables to store my available handler processes. I would love to find an example of another plugin which stores file handles and other information globally but I have been unable to find one that matches what I am doing.