I developed a system that consists of software and hardware interaction. Basically its a transaction system where the transaction details are encrypted on a PCI device then returned back to my web based system where it is stored in a DB then displayed using javascript/extjs in the browser. How I do this now is the following:
Transaction encoding process
1.The user selects a transact开发者_Go百科ion from a grid and presses "encode" button,extjs/js then sends the string to PHP where it is formatted and inserted into requests[incoming_request]. At this stage I start a extjs taskmanager to do interval checks on the requests[response] column for a result, and I display a "please wait..." message.
2.I have created a python daemon service that monitors the requests table for any transactions to encode.The python daemon then picks up any requests[incoming_request] then encodes the request and stores the result in requests[response] table.
3.The extjs taskmanager then picks up the requests[response] for the transaction and displays it to the user and then removes the "please wait..." message and terminates the taskmanager.
Now my question is: Is there a better way of doing this encryption process by using 3rd party Messaging and Queuing middleware systems? If so please help.
Thank You!
I would change it this way:
- make PHP block and wait until Python daemon finishes processing the transaction
- increase the timeout in the Ext.data.Connection() so it would wait until PHP responds
- remove the Ext.MessageBox and handle possible errors in the callback handler in Ext.data.Connection()
I.e. instead of waiting for the transaction to complete in JavaScript (which requires several calls to the webserver) you are now waiting in PHP.
This is assuming you are using Ext.data.Connection() to call the PHP handler - if any other Ext object is used the principle is the same but the timeout setting / completion handling would differ.
精彩评论