Announcement

Collapse
No announcement yet.

MvAsynchronous... batch ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MvAsynchronous... batch ?

    Lets say I have a database with 100 ticket orders, and I want them all purchased at once using MvCall to a third party API.
    I know that trying to send them all at once will result in a timeout and therefore failure.

    Can I have one script that cycles thru the list and generates an asynchronous call 100 times and each of those calls then writes back to my db the resulting info?
    Will this create a big hit to the CPU?
    Are the MvAsynchronous considered multithreaded?
    Would it be better to use some ajax on a timer to kick off the script?

    In the end, I need a way to do as described with the lowest risk of timeout / failure.

    Bill
    William Gilligan - Orange Marmalade, Inc.
    www.OrangeMarmaladeinc.com

    #2
    You should probably make a module that implements the scheduled task feature. Then the async calls are handled for you. You would make an MvCALL and then call ScheduledTask_RecycleRecommended to see if you should exit the task or not. If ScheduledTask_RecycleRecommended returns 1 and you have more processing to do, you would call -1. That tells the scheduled task handler that you are not finished and to call you again. If you are done processing your records you would return 1 to tell the scheduled task handler your task is complete.
    David Carver
    Miva, Inc. | Software Developer

    Comment


      #3
      This is NOT for Merchant. That is why it is posted in the Miva Script forum...
      Any other ideas anyone?
      William Gilligan - Orange Marmalade, Inc.
      www.OrangeMarmaladeinc.com

      Comment


        #4
        Originally posted by dcarver View Post
        You should probably make a module that implements the scheduled task feature. Then the async calls are handled for you. You would make an MvCALL and then call ScheduledTask_RecycleRecommended to see if you should exit the task or not. If ScheduledTask_RecycleRecommended returns 1 and you have more processing to do, you would call -1. That tells the scheduled task handler that you are not finished and to call you again. If you are done processing your records you would return 1 to tell the scheduled task handler your task is complete.
        Is this function documented anywhere?
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment

        Working...
        X