in reply to Re^2: Global variables and SimpleHTTP request handler
in thread Global variables and SimpleHTTP request handler

This is incorrect, run does not return, and doesn't help in sharing data in the way the OP wants.

Why should a server daemon return?

Run isn't responsible for sharing, run is reponsible for NOT forking, so the sharing of a global works

  • Comment on Re^3: Global variables and SimpleHTTP request handler

Replies are listed 'Best First'.
Re^4: Global variables and SimpleHTTP request handler
by haukex (Archbishop) on Jan 03, 2017 at 12:18 UTC

    Hi Anonymous,

    Again, only replacing background with run doesn't help the OP.

    run is reponsible for NOT forking, so the sharing of a global works

    When is this sharing supposed to happen? It seems the OP wants to read from the queue asynchronously, so if the main process is tied up in run, handling requests that write to the queue, when do you propose the process should read the queue? Perhaps you could show some working code as a proof-of-concept of your idea, since I can't tell whether you've got a valid point.

    Regards,
    -- Hauke D