/    Sign up×
Community /Pin to ProfileBookmark

PHP Queuing script executions and recording user with MySql

I have a website that lets user select test scripts from radio buttons, and after submitting the desired test to the remote server, using PHP:

  • 1. It inserts sends a row into MySQL database in the test_activity_log table, with id, username, test name, gateway name, and timestamp.

  • 2. It then sends a `ssh2_exec` to execute the desired script on the remote gateway
  • Everything above I already have working, however, in the case when multiple users are executing scripts from the webpage simultaneously, I need to find a way to queue them up in order and execute them one after another. What would be the best way to do this?

    Any ideas would be much appreciated.

    to post a comment
    PHP

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @NogDogSep 08.2017 — Hmm...when a user makes a request, does the page then wait for the result of their request and display it back to them, or is the user "done" once they have simply posted the request?
    Copy linkTweet thisAlerts:
    @evoluerSep 09.2017 — Hello kkmoslehpour,

    There is a framework called gearman, which is the best to create queues. However like nogdog mentioned, if the result of the query needs to be displayed to the user, queues should not be made.
    ×

    Success!

    Help @kkmoslehpour spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...