Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: Looking for alternative for IPC::Shareable (or increase size)

by jcb (Parson)
on Aug 07, 2020 at 22:16 UTC ( [id://11120483]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Looking for alternative for IPC::Shareable (or increase size)
in thread Looking for alternative for IPC::Shareable (or increase size)

This is a multiprocess application with an SQLite database. Have you considered moving up to PostgreSQL? The agent processes could insert their records into the import table and issue NOTIFY to report completion to the main worker process, which has issued an appropriate LISTEN and uses the pg_notifies method to receive the notifications. (See DBD::Pg for details.)

As an extra benefit, PostgreSQL LISTEN/NOTIFY is integrated with the transaction system: a notification sent during a transaction is held in the database server until the transaction commits.

The catch is that you will need to be careful with your DBI handles: each process needs its own database connection and the "agent" processes must not use the "worker"'s DBI handle by mistake.

  • Comment on Re^5: Looking for alternative for IPC::Shareable (or increase size)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120483]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found