Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ensuring proper usage of InvokeAsync

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

    ensuring proper usage of InvokeAsync

    Is there a proper way of unloading/killing a thread that was called on by using dispatcher -> InvokeAsync?
    Is this something that needs to be done manually or is it already built into .Net?
    Even if it could be done manually, is it considered bad practice to do so?

    I've been getting a lot of "file is already in use by another process" type of errors for the past few releases, so I want to clean up my code to make sure its not the culprit.

    #2
    Hello gubbar924,

    When you invoke into a thread, you would not want to kill the thread you have invoked into.

    For example if you invoke into the main menu and then kill the thread of the main menu that would kill the NinjaTrader UI.

    But to answer this, no, when the method is finished it will return and the invoke will be completed.

    Are you able to reproduce this behavior without using any indicators in your workspace (and with no other workspaces open)?

    Are you able to reproduce this using any of the example indicators on the forums that use Dispatcher.InvokeAsync?

    I'm posting links to a few below.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Chelsea, I just wanted to make sure I wasn't missing anything when it came to invoking. Outside of this question, I have already been working with Patrick on the issue pertaining to the "file already in use by another process" error, I'll follow up with him so just to keep it clean.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      542 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      11 views
      0 likes
      Last Post XXtrader  
      Started by Waxavi, Today, 02:10 AM
      0 responses
      7 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      14 views
      0 likes
      Last Post TradeForge  
      Working...
      X