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

  • Home
  • SEARCH
  • 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 7845019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:05:09+00:00 2026-06-02T17:05:09+00:00

I plan do program a simple data flow framework, which basically consists of lazy

  • 0

I plan do program a simple data flow framework, which basically consists of lazy method calls of objects. If I ever consider distributed programming, what is the easiest way to enable that in Python? Any transparent solution without me doing network programming?

Or for a start, how can I make use of multi-core processors in Python?

  • 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-02T17:05:13+00:00Added an answer on June 2, 2026 at 5:05 pm

    lazy method calls of objects

    Can be anything at all really, so let’s break it down:

    Simple Let-Me-Call-That-Function (RPC)

    Well lucky you! python has the one of greatest implementations of Remote Procedure Calls:
    RPyC.

    Just run the server (double click a file, see the tutorial),

    Open an interpreter and:

    import rpyc
    conn = rpyc.classic.connect("localhost")
    data_obj = conn.modules.lazyme.AwesomeObject("ABCDE")
    print(data_obj.calculate(10))
    

    And a lazy version (async):

    # wrap the remote function with async(), which turns the invocation asynchronous
    acalc = rpyc.async(data_obj.calculate)
    res = acalc(10)
    print(res.ready, res.value)
    

    Simple Data Distribution

    You have a defined unit of work, say a complex image manipulation.
    What you do is roughly create Node(s), which does the actual work (aka, take an image, do the manipulation, and return the result), someone who collect the results (a Sink) and someone who create the work (the Distributor).

    Take a look at Celery.

    If it’s very small scale, or if you just want to play with it, see the Pool object in the multiprocessing package:

    from multiprocessing import Pool
    p = Pool(5)
    def f(x):
         return x*x
    print(p.map(f, [1,2,3]))
    

    And the truly-lazy version:

    print(p.map_async(f, [1,2,3]))
    

    Which returns a Result object which can be inspected for results.

    Complex Data Distribution

    Some multi-level more-than-just-fire&forget complex data manipulation, or a multi-step processing use case.

    In such case, you should use a Message Broker such as ZeroMQ or RabbitMQ.
    They allow to you send ‘messages’ across multiple servers with great ease.

    They save you from the horrors of the TCP land, but they are a bit more complex (some, like RabbitMQ, require a separate process/server for the Broker). However, they give you much more fine-grained control over the flow of data, and help you build a truly scalable application.

    Lazy-Anything

    While not data-distribution per se, It is the hottest trend in web server back-ends: use ‘green’ threads (or events, or coroutines) to delegate IO heavy tasks to a dedicated thread, while the application code is busy maxing-out the CPU.

    I like Eventlet a lot, and gevent is another option.

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

Sidebar

Related Questions

I am making a simple program which suppose to accept txt file data from
I plan to delete an entire table with over 930,000 rows of data. Which
I'm planning to write a program in Ruby to analyse some data which has
I'm developing a BlackJack program which shows a BlackJack Table, cards, etc. The plan
I plan on building a simple, yet high usage webapp and need to settle
I plan to start learning a Java web framework (I love the Java API)
I wrote a fairly simple GUI program to automate a few processes for Windows
I am trying to make a simple client-server chat program. On the client side
I wrote a simple logging function which displays a timestamp and uses vprintf() to
I'm designing a program I plan to implement in C and I have a

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.