Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:53:19+00:00 2026-06-10T19:53:19+00:00

Imagine inter-processes communication +————–+ +————+ | main_process | ==produces data somewhat to=> | monitoring

  • 0

Imagine inter-processes communication

+--------------+                               +------------+
| main_process | ==produces data somewhat to=> | monitoring |
+--------------+                               +------------+

where:

  • the main_process is running non-stop and produces some data for monitoring
  • the monitoring is running only sometimes, and when it is running it should read the data produced by main_process
  • and when the monitoring is not running the data produced by main_process should be not saved.

The question is: How to write like “on demand” IPC?

The code for main_process is basically the next (the real one is more complicated):

use 5.014;
use warnings;
my $box = new BlackBox( callback =>  sub {
    my ($self, $jref) = @_;
    #
    # processing of $jref
    #
});
$box->run();

The callback is called every 2-5 seconds and as i told above, this process should run non-stop. I can’t change the BlackBox.

I need:

  • write the processing of $jref part – what should send $jref to somewhere
  • and the monitoring process itself, what should read the data, when it is running…

Don’t need any code, need only some pointers to the right direction, or idea how to do this, without filling up my memory or HDD, so the simplest way:

  • write the $jref to the file is not suitable because it will fill my HDD when the monitoring is not running.

If someone care, the $jref is a reference to json string, so i can do:

 use JSON::XS qw(decode_json):
 my $perlref = decode_json($$jref);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:53:20+00:00Added an answer on June 10, 2026 at 7:53 pm

    My first thought was “UDP to localhost?”

    Variations on that idea include AF_UNIX or a named pipe. With a stream socket you’d do a non-blocking connect, and with the pipe you’d do O_WRONLY|O_NONBLOCK, and if you get EAGAIN just return without writing.

    You can save your file handle and reuse it across multiple calls, just close it and reopen if you get EPIPE. You’ll want $SIG{PIPE}='IGNORE'; hopefully the black box doesn’t object to that.

    The reading side is as simple as cat $path_to_fifo or nc -l -u -p $udpport, slightly harder if you do an AF_UNIX socket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I've got a database with lots of data, from which users can search.
Imagine a quadtree defined as follow: data (Eq a, Show a) => QT a
I am writing a simple server (publisher) and client (subscriber) application to imagine inter-process
Imagine two servers (each within an own jvm process) which communicate using some form
I am having trouble trying to get iterators for inner sub-containers. Basically imagine this
Imagine a cube-shaped piece of Swiss cheese. We model the cheese through a 20x20x20
imagine this html on a page <div id=hpl_content_wrap> <p class=foobar>this is one word and
Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
Imagine I want to draw a pyramid made of triangles. -Should I create a
Imagine an architecture composed of 2 Virtual Machines VM1 and VM2 hosted somewhere in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.