/    Sign up×
Community /Pin to ProfileBookmark

How to process commands

hello,
i am designing a web app using php and jquery. the app has several commands to choose( can choose multiple commands) and several servers to choose from.

i would like to know conceptually, when i click process x commands on y servers, how to track these commands and output them…

for example output:
command a executed
command b executed
command c timed out

how do i keep track of what happened to each command in order to output all details in html ? because what is happening now is that i am able to output only one command’s result at a time, because as soon as the next command execution finishes it outputs and the details of the previous command gets deleted.
i dun want to store all details in a text file to output them coz i know its bad programming.
so any ideas?

thx a lot for your help?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@sohguanhMay 25.2010 — hello,

i am designing a web app using php and jquery. the app has several commands to choose( can choose multiple commands) and several servers to choose from.

i would like to know conceptually, when i click process x commands on y servers, how to track these commands and output them...

for example output:

command a executed

command b executed

command c timed out

how do i keep track of what happened to each command in order to output all details in html ? because what is happening now is that i am able to output only one command's result at a time, because as soon as the next command execution finishes it outputs and the details of the previous command gets deleted.

i dun want to store all details in a text file to output them coz i know its bad programming.

so any ideas?

thx a lot for your help?[/QUOTE]


Errr... even for Web servers they also have logs to keep track of the HTTP requests coming in. Now you say it is bad programming to store details in a text file ? Web server logs are text files essentially.

My next question is you have command a, b, c and they could be sent to y1, y2, y3 etc servers. This is tricky. To maintain a coherent picture of all the commands a, b, c we need to get all the y1, y2, y3 servers log and then maybe based on the log entries time-stamp filter and extract in sorted order.

Above sounds like Perl will do a good job in matching entries from various log files but is what I describe what you intended ?
Copy linkTweet thisAlerts:
@chadzauthorMay 25.2010 — thx a lot for you reply.

wt i mean is, should i store the status of each sent command in the session for example? in objects? like i wanna display which command was processed and wt is it status: passed or failed

but how do i do that if i have several commands sent together? like where do u keep track of each command and display each one as soon as it has finished executing? in objects? in session ? in database... hope u understand what i mean,

i wanna display in a div each command as soon as it has finished processing with failed or passed status...then display the one after it when done processing

command a passed

..then below it

command b passed

etc..

how do i keep track of them to display each as soon as its finished processing? thats why i was thinking text file..
Copy linkTweet thisAlerts:
@sohguanhMay 25.2010 — but how do i do that if i have several commands sent together? like where do u keep track of each command and display each one as soon as it has finished executing? in objects? in session ? in database... hope u understand what i mean,

i wanna display in a div each command as soon as it has finished processing with failed or passed status...then display the one after it when done processing

command a passed

..then below it

command b passed

etc..

how do i keep track of them to display each as soon as its finished processing? thats why i was thinking text file..[/QUOTE]


So you are referring to the web page display after commands have been sent to the server from processing is it ?

If that is the case, you can use AJAX instead. Based on the return status you populate the HTML page accordingly. Since each request is reserved a place in the HTML, they should not overwrite. If you didn't reserve then can use the append method of DOM.
×

Success!

Help @chadz 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.20,
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,
)...