Search Unity

Asynchronous webservice for Unity games

Discussion in 'Scripting' started by kosted, Oct 20, 2019.

  1. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Hi all. I am looking to develop an asynchronous module in Unity to interact with my backend.

    For example, suppose that the user clicks a "pay" button, he can afford some time before the return of the action is done. It is even possible that the app is closed in the meantime and the payment has been validated, so the app must receive the callback.

    Someone with an idea of how to develop that in C#? In java I would have used JMS or Middleware but here I am a little stuck

    Thanks
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
  3. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Thanks for your answer.
    I'm going to search again on internet because UnityWebRequest is a synchrone system.
    My game will be deployed in some countries in Africa, everything there are asynch, so I don't have the choice
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    If you want to be pedantic, the CPU only does one thing at a time.

    If you want to have a really hard time doing web requests, suit yourself. I've used UnityWebRequest for years now and it always just works the way I need.

    This makes absolutely zero sense. Everything in Africa uses commodity internet hardware and software. How on earth did you ever think it is different than the rest of the world?! Do you think there is a special tech center in Africa developing tech that is only used on that continent?!
     
  5. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Maybe I explain very bad my issue. Sorry
    In Africa many people use mobile money system because they don't have a bank account. Transactions using mobile money are asynchrone and take more time because, there a lot of processes and validation. For example in Europe, with your credit card, in your game, when you buy something, the app can wait for the result because, it is a synchronous system.

    In many countries in Africa our game must implement an async system, so even if it takes 15 min before the validation of the payement, our game doesn't miss the callback at the end.