[Chicago-talk] Java API/Perl revisited

Jay Strauss me at heyjay.com
Fri Nov 14 10:21:58 CST 2003


Would the following be sorta like what you mean. 

> - Fork and use IPC for the data transfer (perldoc perlipc).
>   Given the way data is handled, setting up a pipe is probably
>   the simplest fix.

package userFunctions;
sub new {...};
sub priceChange {...};
1;

package socketMaster;
sub new {...};
setup socket
fork
 if (child) {
  while (1) {
   read socket
   examine message
   # call appropriate function sorta like next line
   $self->{userFunctions}->priceChange;
  }
 }

sub sendMessage {...};
1;

# Then later in my perl code

my $userFuncs = userFunctions->new();
my $socketMaster = socketReader->new($userFuncs);
$sockMaster->sendMessage("some message");





More information about the Chicago-talk mailing list