Place another bet without waiting 1 second ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IGtrader
    Junior Member
    • Apr 2012
    • 18

    #1

    Place another bet without waiting 1 second ?

    On the old API it was possible to place a bet and use a callback function for the result.

    This was very useful when placing trades on fast moving in play horse racing.

    I can't see a way to do this on the new API so after I place a bet on a horse race in play the program hangs for 1 second.

    I invariable would like to place another bet before that 1 second is over.
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Place your bet on a background thread (or just a thread) and use another thread if you want to place another bet.

    Comment

    • StefanBelo.
      Junior Member
      • Jan 2009
      • 105

      #3
      Originally posted by betdynamics View Post
      Place your bet on a background thread (or just a thread) and use another thread if you want to place another bet.
      Are you actually a software developer?
      betfair bot platform, bfexplorer bot sdk

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        Originally posted by StefanBelo. View Post
        Are you actually a software developer?
        And the relevance of your question is what exactly?
        Last edited by betdynamics; 03-04-2016, 07:50 PM.

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Advice rescinded.
          Last edited by jabe; 06-04-2016, 04:21 AM.

          Comment

          • Lopiner
            Junior Member
            • Feb 2009
            • 117

            #6
            Originally posted by jabe View Post
            Advice rescinded.
            Why Jabe?

            Usually this is a very polite forum, something that i appreciate.
            betdynamics is someone known to be very available to help other users, which is also very nice.

            His advice of using a thread is not absurd. You will have to use some kind of async operation to achieve that. The API used to have async methods, but they dropped those, so you will have to use some kind of async operation on your side, that's the only way of avoiding you app to wait for the betfair servers response.

            Maybe there is some better alternative to a thread, we would all like to ear and learn from someone who is more trained about this.
            fooledbyabet.com

            Comment

            • jptrader
              Junior Member
              • Nov 2009
              • 82

              #7
              Originally posted by Lopiner View Post
              Why Jabe?

              Usually this is a very polite forum, something that i appreciate.
              betdynamics is someone known to be very available to help other users, which is also very nice.

              His advice of using a thread is not absurd. You will have to use some kind of async operation to achieve that. The API used to have async methods, but they dropped those, so you will have to use some kind of async operation on your side, that's the only way of avoiding you app to wait for the betfair servers response.

              Maybe there is some better alternative to a thread, we would all like to ear and learn from someone who is more trained about this.
              I second everything Lopiner said. I can add that e.g. in C#, this would most easily be obtained by using the async/await pattern. This would not create extra threads, but would still not use time on the thread while waiting for replies. Similar constructs exists in e.g. Python, while other languages may require the creation of extra threads.

              Comment

              • betdynamics
                Junior Member
                • Sep 2010
                • 534

                #8
                Note - under Windows, async/await is only available in .Net 4.5 and above.

                [It may have been retrofitted to .Net 3.5 and .Net 4.0 by now, but it certainly wasn't last time I checked (which was some time ago)]

                Comment

                • jptrader
                  Junior Member
                  • Nov 2009
                  • 82

                  #9
                  According to Microsoft, it is available to .NET 4.0 by using https://www.nuget.org/packages/Microsoft.Bcl.Async/. (but have never tried this myself)

                  Comment

                  • betdynamics
                    Junior Member
                    • Sep 2010
                    • 534

                    #10
                    Originally posted by jptrader View Post
                    According to Microsoft, it is available to .NET 4.0 by using https://www.nuget.org/packages/Microsoft.Bcl.Async/. (but have never tried this myself)
                    Thanks - that is useful to know.

                    Comment

                    • jabe
                      Senior Member
                      • Dec 2014
                      • 705

                      #11
                      Originally posted by Lopiner View Post
                      Why Jabe?

                      Usually this is a very polite forum, something that i appreciate.
                      betdynamics is someone known to be very available to help other users, which is also very nice.

                      His advice of using a thread is not absurd. You will have to use some kind of async operation to achieve that. The API used to have async methods, but they dropped those, so you will have to use some kind of async operation on your side, that's the only way of avoiding you app to wait for the betfair servers response.

                      Maybe there is some better alternative to a thread, we would all like to ear and learn from someone who is more trained about this.
                      I agree with all you say and totally support BetDynamics and what he said. My original post said something along these lines:

                      "My program (written in VB.NET), once past its initialisation stage, uses asynchronous threads for ALL API calls. Using async calls means each can afford to wait for its response."

                      I decided, rightly or wrongly, to remove it until I saw a response to BetDynamics' query about the relevance of StefanBelo's question. Perhaps I should have worded the edited version differently; it was my advice that I rescinded.

                      I should add that I'm still writing my program, haven't used "await", and need to do something (not really sure what yet) about time-outs and loss of web connection.
                      Last edited by jabe; 06-04-2016, 02:43 PM.

                      Comment

                      • StefanBelo.
                        Junior Member
                        • Jan 2009
                        • 105

                        #12
                        Originally posted by betdynamics View Post
                        Note - under Windows, async/await is only available in .Net 4.5 and above.

                        [It may have been retrofitted to .Net 3.5 and .Net 4.0 by now, but it certainly wasn't last time I checked (which was some time ago)]
                        Therefore I asked you if you are actually a software developer/programmer. Man, just read your posts to my comments here, back in history. You lectured me about programming.

                        Async/await is not .net version related feature it is actually programming language construct introduced to C# and VB.net programming languages from F#, what is also one of .net programming languages.

                        .NET platform is not just windows programming platform anymore for quite a long time now.

                        Before lecturing and actually advising bullshit, learn yourself in area where you try to advice something to anyone.

                        On .net 2.0, and I must wonder who would like to program for .net 2.0 in year 2016, you can use event based asynchronous pattern.
                        betfair bot platform, bfexplorer bot sdk

                        Comment

                        • Lopiner
                          Junior Member
                          • Feb 2009
                          • 117

                          #13
                          Originally posted by jabe View Post
                          I agree with all you say and totally support BetDynamics and what he said. My original post said something along these lines:

                          "My program (written in VB.NET), once past its initialisation stage, uses asynchronous threads for ALL API calls. Using async calls means each can afford to wait for its response."

                          I decided, rightly or wrongly, to remove it until I saw a response to BetDynamics' query about the relevance of StefanBelo's question. Perhaps I should have worded the edited version differently; it was my advice that I rescinded.

                          I should add that I'm still writing my program, haven't used "await", and need to do something (not really sure what yet) about time-outs and loss of web connection.
                          Ah, i understand now Jabe, i didn't notice it was an edit, sorry.
                          I too, once past the initialization, that is sequential, use threads. I thought about spinning every API request in a thread pool but i then gave up because performance was good enough and i didn't want to embrace the concurrency issues that might occur. Im still using a thread pool for some operations.
                          I'm also using VB.Net, i haven't experiment with the Async/Await, i have read about it but haven't fully realized differences between tasks, threads, for parallel, and so on. Will give it a try. If some one cares to show an example of a placebet with the async await in .net it would be great.
                          Last edited by Lopiner; 06-04-2016, 05:24 PM.
                          fooledbyabet.com

                          Comment

                          • betdynamics
                            Junior Member
                            • Sep 2010
                            • 534

                            #14
                            Originally posted by StefanBelo. View Post
                            Man, just read your posts to my comments here, back in history. You lectured me about programming.
                            I don't believe I have ever lectured anyone about programming - please point me to a direct example where I have lectured you.

                            Originally posted by StefanBelo. View Post
                            Before lecturing and actually advising bullshit, learn yourself in area where you try to advice something to anyone.
                            I don't believe I am lecturing anyone, nor can I see any bullshit in the statements that I have given.

                            The async/await keywords were added to C# version 5.0 (released with .Net 4.5). There have always been ways of achieving asynchronous operation, but I was specifically talking about the async/await keywords.

                            Originally posted by StefanBelo. View Post
                            On .net 2.0, and I must wonder who would like to program for .net 2.0 in year 2016, you can use event based asynchronous pattern.
                            This has nothing to do with async/await.

                            Clearly you disagree with my comments - that is your perogative. However, please keep your interactions civil and, if you have anything to add to the conversation, then please post it so we can all learn.

                            If you just want to snipe, then save your breath. Nobody wants to hear it.
                            Last edited by betdynamics; 06-04-2016, 06:08 PM.

                            Comment

                            • betdynamics
                              Junior Member
                              • Sep 2010
                              • 534

                              #15
                              Originally posted by StefanBelo. View Post
                              Man, just read your posts to my comments here, back in history. You lectured me about programming.
                              This genuinely concerned me as I have no recollection of ever engaging with StefanBelo. over any programming matters, so I thought I would look back through my history on the forum.

                              I can only find 5 other instances where StefanBelo. and myself have commented on the same thread:

                              CANT GET LISTRACEDETAILS COMMAND TO WORK
                              THE MATHEMATICS OF ADJUSTMENT FACTOR
                              REPRODUCE BETFAIR WEB SITE EVENT TREE
                              PROBLEM WITH DATA CONSISTENCY
                              MANY UNEXPECTED_ERROR THIS MORNING

                              None of these seem to support the assertion that I have ever lectured StefanBelo. on anything!

                              I strongly suspect that he has mixed me up with someone else (algotrader perhaps), so I am not quite sure why he has decided to post in the manner that he has.

                              Comment

                              Working...
                              X