Coder Social home page Coder Social logo

Comments (4)

csurfer avatar csurfer commented on June 22, 2024

@jfunez: You can do that now too, with python queue (https://docs.python.org/3.6/library/queue.html) . Queues in python are thread-safe and so you can push things into queue from one thread and pull from another thread and in this way you can achieve communication between threads.

Does this answer your question or did you have anything else in mind?

from pypette.

jfunez avatar jfunez commented on June 22, 2024

@csurfer not exactly what I have in mind... Maybe this example could help to understand:

In a simple pipeline with three jobs:

J1 -> J2 -> J3
  1. In J1, I would collect the data from external source (DB, API, etc)
  2. In J2,I would run a data manipulations process with the data returned from J1, then J2 return the data transformed
  3. In J3 I would persist the result if the data given by J2 have some specific value

I know it could be possible to achieve it with a queue as you said, but maybe the Job could return an iterator/generator that would be passed to the next Job in the pipeline, the the later could make a decision without having all the data in a single "global" queue. you know the output of one element is the input of the next one

HTH

from pypette.

ndemou avatar ndemou commented on June 22, 2024

@jfunez I love pyfunctional for working exactly that way. seq(generator).map(...).map(...)...

from pypette.

jfunez avatar jfunez commented on June 22, 2024

Hi @ndemou
PyFunctional looks very interesting!!! Thanks for the tip, I'll take a look more deeply for sure!

from pypette.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.