How can I run two scripts on Heroku?









up vote
-1
down vote

favorite












I'm building a Dash Webapp, I have two Python scripts: one is the main Dash app and the other script is supposed to retrieve data.



Since I can't "merge" my two scripts on one, I decided to have the second script send my data to a Database while the Dash script receives this data with a DB query.



Now I need to deploy it online and have both the scripts running in parallel, since one will feed data to the DB and the other one will fetch this data and chart it on a webpage, but is it possible to run at once two Python files in parallel? Can I do it on a single dyno or should I use two different apps (one for the webapp and another one for the data)?










share|improve this question



























    up vote
    -1
    down vote

    favorite












    I'm building a Dash Webapp, I have two Python scripts: one is the main Dash app and the other script is supposed to retrieve data.



    Since I can't "merge" my two scripts on one, I decided to have the second script send my data to a Database while the Dash script receives this data with a DB query.



    Now I need to deploy it online and have both the scripts running in parallel, since one will feed data to the DB and the other one will fetch this data and chart it on a webpage, but is it possible to run at once two Python files in parallel? Can I do it on a single dyno or should I use two different apps (one for the webapp and another one for the data)?










    share|improve this question

























      up vote
      -1
      down vote

      favorite









      up vote
      -1
      down vote

      favorite











      I'm building a Dash Webapp, I have two Python scripts: one is the main Dash app and the other script is supposed to retrieve data.



      Since I can't "merge" my two scripts on one, I decided to have the second script send my data to a Database while the Dash script receives this data with a DB query.



      Now I need to deploy it online and have both the scripts running in parallel, since one will feed data to the DB and the other one will fetch this data and chart it on a webpage, but is it possible to run at once two Python files in parallel? Can I do it on a single dyno or should I use two different apps (one for the webapp and another one for the data)?










      share|improve this question















      I'm building a Dash Webapp, I have two Python scripts: one is the main Dash app and the other script is supposed to retrieve data.



      Since I can't "merge" my two scripts on one, I decided to have the second script send my data to a Database while the Dash script receives this data with a DB query.



      Now I need to deploy it online and have both the scripts running in parallel, since one will feed data to the DB and the other one will fetch this data and chart it on a webpage, but is it possible to run at once two Python files in parallel? Can I do it on a single dyno or should I use two different apps (one for the webapp and another one for the data)?







      python heroku






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 21:14









      petezurich

      3,37881633




      3,37881633










      asked Nov 9 at 20:53









      Jack022

      810




      810






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Check this. It says:




          The quickest way maybe to list the commands to run, each followed by
          an &, with a wait -n in the end, in the Procfile, e.g.:



          web: puma -C config/puma.rb & sidekiq & wait -n







          share|improve this answer




















          • I'll try this, thanks!
            – Jack022
            Nov 9 at 22:29






          • 1




            @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
            – Cheche
            Nov 9 at 22:33










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233129%2fhow-can-i-run-two-scripts-on-heroku%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Check this. It says:




          The quickest way maybe to list the commands to run, each followed by
          an &, with a wait -n in the end, in the Procfile, e.g.:



          web: puma -C config/puma.rb & sidekiq & wait -n







          share|improve this answer




















          • I'll try this, thanks!
            – Jack022
            Nov 9 at 22:29






          • 1




            @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
            – Cheche
            Nov 9 at 22:33














          up vote
          1
          down vote



          accepted










          Check this. It says:




          The quickest way maybe to list the commands to run, each followed by
          an &, with a wait -n in the end, in the Procfile, e.g.:



          web: puma -C config/puma.rb & sidekiq & wait -n







          share|improve this answer




















          • I'll try this, thanks!
            – Jack022
            Nov 9 at 22:29






          • 1




            @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
            – Cheche
            Nov 9 at 22:33












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Check this. It says:




          The quickest way maybe to list the commands to run, each followed by
          an &, with a wait -n in the end, in the Procfile, e.g.:



          web: puma -C config/puma.rb & sidekiq & wait -n







          share|improve this answer












          Check this. It says:




          The quickest way maybe to list the commands to run, each followed by
          an &, with a wait -n in the end, in the Procfile, e.g.:



          web: puma -C config/puma.rb & sidekiq & wait -n








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 21:53









          Cheche

          780118




          780118











          • I'll try this, thanks!
            – Jack022
            Nov 9 at 22:29






          • 1




            @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
            – Cheche
            Nov 9 at 22:33
















          • I'll try this, thanks!
            – Jack022
            Nov 9 at 22:29






          • 1




            @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
            – Cheche
            Nov 9 at 22:33















          I'll try this, thanks!
          – Jack022
          Nov 9 at 22:29




          I'll try this, thanks!
          – Jack022
          Nov 9 at 22:29




          1




          1




          @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
          – Cheche
          Nov 9 at 22:33




          @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check this
          – Cheche
          Nov 9 at 22:33

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233129%2fhow-can-i-run-two-scripts-on-heroku%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Syphilis

          Darth Vader #20