PubSub or workflows or both?
0
0
Entering edit mode
5.4 years ago
Kermit ▴ 90

I am building a chemistry application with django that focuses on reactions. It bonds an atom to an existing molecule. The reaction event triggers a bunch of (a) validations to make sure the feasibility of the molecule checks out (b) subsequent events as the molecule


Nested Functions:

So I could have my logic layer just keep feeding Python functions into other Python functions, but my fear is that this will become a tangled mess quickly. I also want to have a record of the steps with success/fail and other basic stats, so one hanging process is probably not the best.


PubSub:

So I could have multiple functions that subscribe/ listen for a reaction and then run/ don't run based on criteria. Using something like django-redis-pubsub.


Workflows:

Enter workflows. I suppose I could structure the whole reaction process as a giant workflow which would have better transaction atomicity? Should I combine this approach with a pubsub?

rule NAME: 
    input:
        "path/to/inputfile",
        "path/to/other/inputfile" 
    output:
        "path/to/outputfile",
        "path/to/another/outputfile" 
    script:
        "path/to/script.py"
  
workflow pubsub events python • 1.2k views
ADD COMMENT

Login before adding your answer.

Traffic: 2116 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6