What is the proper way to set up how to stop a web worker?

The example here uses a pair of bools which is simple and does the job.
The sample code created when you create a web worker shows using a CancellationTokenSource & a ManualResetEvent which is quite different.
What's the suggested approach. And if it's CancellationTokenSource & a ManualResetEvent - is there something that explains how best to use them? The sample code provides no hints about how to do this.
thanks - dave
What we did for the last 6 months -
Made the world's coolest reporting & docgen system even more amazing

Hi David,
We usually use the worker role to host the long running application process, and we can use the Sleep method to reduce the resource usage like below:
public class WorkerRole : RoleEntryPoint
public override void Run()
{ while (true)
Thread.Sleep(10000);
//your work .......
public override bool OnStart()
ServicePointManager.DefaultConnectionLimit = 12;
return base.OnStart();
If you prefer to use the CancellationTokenSource & ManualResetEvent with WorkerRole and make your application more consecutive. There is a excellent example provided by Bibhu, I suggest you take a look at it.
http://www.codeproject.com/Articles/810308/Creating-an-Azure-Cloud-Service
Best Regards,
Fuxiang
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

Similar Messages

  • What is the proper way to set up an encoder on an Elvis prototyping board with Labview 2010?

    I am using a PCI-6024E with an Elvis I and MCU Project Board. I've tried using the quadratureencoderm-series.vi as well as experimenting with the counter channels in the Measurement and Automation Explorer; however I have been unable to find the proper channels to read the data from this encoder. I'm having trouble configuring the counter to work properly. Can anyone tell me which pins I should be connecting the encoder signals to? I've attached a datasheet for the motor and the encoder. Any help would be appreciated.
    Attachments:
    MT-003-datasheet.pdf ‏381 KB

    Hi jns0086,
    I see your problem.  I believe that example was written using Traditional DAQ, a set of drivers and functions that have since been replaced by DAQmx. What version of LabVIEW and Windows are you using?  There are some compatibility issues depending on your version on LabVIEW and your operating system.
    In the meantime, if you have everything connected properly, you should be able to count your edges using one of the built-in LabVIEW examples.  Go to Help>Example Finder and then browse for Hardware Input and Output > DAQmx > Counter Measurements > Count Digital Events > Count Digital Events.vi.  See if that helps.
    Have a great day,
    Chris
    Applications Engineering
    Applications Engineer
    National Instruments

  • What is the proper way to set character encoding in an HTTPService request?

    I'm trying to get an HTTPService object's request to have
    proper character encoding. If I do nothing, I get "null" inside a
    Java servlet when I call getCharacterEncoding() on the request
    object. If I do this to my Flex HTTPService:
    httpService.contentType = "application/x-www-form-urlencoded;
    charset=UTF-8";
    then I get a valid character encoding (UTF-8) in the Java
    servlet as I should. But the problem is that my HTTPService's POST
    parameters are no longer coming along with the request. If I drop
    the charset value and set this instead in Flex:
    httpService.contentType =
    "application/x-www-form-urlencoded";
    then I get my POST params in my servlet just fine, but of
    course, no charset info.
    (For completeness, I am also setting: httpService.method =
    "POST"; and httpService.resultFormat = "e4x"; as well as the URL.)
    How do I send charset info without interfering with the
    transmission of the POST params? This is a serious flaw for anyone
    doing UTF-8 content, because most servers are going to assume
    ISO-8859-1 if you don't send anything specific. It's interesting
    that Flex is actually encoding in UTF-8. I know, because I am
    currently working around the problem by intercepting the HTTP
    request in my servlet and forcing the character encoding to UTF-8
    before binding the params. That's a lousy workaround, though.
    Hint to Flex 3 developers: It would be much more preferable
    to have a setCharacterEncoding method (or characterEncoding prop)
    on the Flex HTTPService.

    Hello,
    I realize this is an old thread, but the problem still seems
    to exist in Flex 3 and I run into it
    Unfortunately I don't understand the workaround.
    Could someone point out in a bit more detail how this should
    be done?
    Many thanks indeed,
    Peter
    _servlet = new HTTPService();
    _servlet.url= ...;
    _servlet.resultFormat=_resultFormat;
    _servlet.addEventListener(ResultEvent.RESULT,onServiceActionResult);
    _servlet.addEventListener(FaultEvent.FAULT,onServiceActionFault);
    _servlet.requestTimeout=_timeout;
    _servlet.contentType=_requestMimeType;
    _servlet.method=_method;
    XML.prettyPrinting=false;
    if(sdk13922Workaround) {
    _servlet.request=params;
    this._token=_servlet.send(null);
    } else {
    _servlet.request=request;
    this._token=_servlet.send(_params);
    quote:
    Text

  • What is the proper way to set up to capture from Flash cards?

    I'm using a 7D for video. This camera uses flash cards. When I choose 'capture' from the file menu the error message says video deck is not connected. Should I plug in the camera to read the video or can I use (preferred) the flash card stuck in a card reader? Obviously just a beginner with this and want to get off to the correct start.

    skalicki` wrote:
    Yup! If you create a new sequence and place one of your converted clips in it, it shouldn't have to render. If you find that you are struggling with the learning curve of FCE, I would recommend getting one of two training books:
    1. [Final Cut Express 4 Editing Workshop|http://www.amazon.com/Final-Cut-Express-Editing-Workshop/dp/0240810775/ref=sr12?ie=UTF8&s=books&qid=1240436986&sr=8-2] by Tom Wolsky. This is how I learned the program and I can assure you that it is a comprehensive guide with everything from basic to more advanced techniques. I highly recommend it. Tom is a frequent contributor to this forum, so if you had any questions about a lesson then he'd be here to help you out.
    2. [Apple Pro Training Series: Final Cut Express 4|http://www.amazon.com/Apple-Pro-Training-Final-Express/dp/0321534670/ref=sr14?ie=UTF8&s=books&qid=1240437118&sr=8-4] by Diana Weynand. Though I can't vouch for it personally, I have heard from many people who were pleased with their experience learning from this book, and I'm sure it is quite good also.
    This is amazing, First: 1.) A clip doesn't have to render if it is imported using those settings? But it will have to render if I make changes to it and want to view it? Every time I edit and then want to see the changes played back, I have to wait for.....ev.......er while it renders again and before I can see it. That much is always a pain but a necessary one - I thought.
    2.) I always struggle learning new things so nothing new there. I do have Tom's book and that is what is guiding me to be where I am now. I am on page 62 studying 'Strategies for Capturing" today. I must say that what you have added here to my understanding is beyond what is included in the book, so I feel reinforced with the basics of set-up now and even the comment you made elsewhere about "M for Mark Clip." I'm furiously writing notes into Tom's book as I go along and accumulate clearer understanding thanks to your added explainations.
    I know nothing about the "Apple Pro Training Series: Final Cut Express 4" book by Diana Weynand, but am off on my way to look it up and check it out.
    As evidenced by our discussions here, there are different ways of saying things, and different pieces to every puzzle, so while Tom's book may be complete, I am also getting more by paying attention to the answers I am getting here also.
    Thank You,
    Ken

  • What is the proper way to record line numbers in Master/Detail records?

    Guys and Gals,
    Been thinking about this for awhile, but thought it best to ask the people who really know what they are doing.
    What is the proper way to record & show line numbers in a Master / Detail record set?
    For example, take Master/Detail relationship Orders and OrderItems. Orders has a column Document_Number and OrderItems has Document_Number, Line_Number. Line_Number should contain the row number 1,2,3,4 ... etc. for each row in a document.
    Should I ...
    <ol><li>Add a sequence and a trigger in the database? The FusionOrderDemo does this, but then the sequence never "resets" and I've got row numbers that keep incrementing. So one document has rows 4,5,6 and the next document has 7,8,9 when they should both have 1,2,3.</li>
    <li>Programmatically take care of the row numbers? This seems like I'm asking for trouble. Anytime an insert or delete operation gets done, I'll have to iterate through rows and re-assign row numbers.</li>
    <li>Is there a way to assign row numbers in a table iterator (or data collection?) to an entity?</li></ol>
    Any suggestions would be appreciated. It's looking like #2 is my only option, but if anyone knows different I'd love the input.
    Will

    Thank you both guys.
    As John said, I believe I'm looking for a gap-free sequence per master record.
    The line number of the OrderItems table is the second half of the primary key. The first half of the primary key (DocumentNumber) is the foreign key to the Orders table.
    Think of it like line items on an order or invoice. For example, if you were talking to someone on the phone concerning an invoice, you might say, "The pricing for line item #3 is incorrect." In this case, it's good to have a common reference. Or imagine a Microsoft Excel spreadsheet with no row numbers displayed! You'd never get anywhere if you had to explain something over the phone.
    If this is tricky to perform, I take it using a sequence and trigger such as the Fusion Order Demo is the best way to approach the challenge for simplicity's sake?
    Will

  • What is the Proper way to nullify the VECTOR after it's scope is over

    I am using Vectors and Array lists at many places in my Web Application, It is neccessary to use them.
    In some processes I m storing bulk amount of data into vector due to that the performance of my application will be decreased, for that I have to nullify the vector after it's scope is over.
    To nullify I m using Vector v = new Vector()
    v.clear().
    The above method is suitable in case of simple object data like strings and other values.
    But I wanna know that If I m using HashMap and storing bulk data in it and then I m storing each HashMap into vector, what is the proper way.
    Does I have to iterate each object of HashMap from vector and set them as null and then set vector as null or directly I can use v.clear() method??
    If any having any answer regarding my question then plz reply your each valuable reply will be appriciable.
    Thanks in advance......!!

    JBOSS2000 wrote:
    Each time in loop a new object of vector is created and each time I m nullifying it. Thats what I m doing.
    Thats why I m nullifying it.
    Even if I'll declare it out side the loop then also for the each iteration I have to nullify it cause what I m doing is I m inserting the data into database in each iteration of loop, So that I think it is must to nullify the objects each time.If it is constructed inside the loop then you do not have to nullify it. If it is constructed outside of the loop and you want to empty it for each iteration then just clear() it.

  • What is the Proper Way to "Sync My Music & Apps to a New Computer Using ITunes"

    What is the Proper Way for Me to "Sync My Music, Pictures & Apps to a New Computer Using ITunes"?
    I had to buy a New Computer since my other one went out, but when I log into ITunes with the New Computer using My Apple ID "Nothing is there"...
    None of My Previously Purchased Music or Apps are in My ITunes Media Library; so, I any not sure how to Properly Proceed with Syncing?
    Any Help & Guidance would be Greatly Appreciated!!!
    Thanks,
    Don

    Sounds like something might be wrong there. Years ago I set up the playlists to sync to my iPhone and 'Everything' for my iPod and I've never needed to change or even check it since, ever.
    However, how and why are you 'restoring' the iPod? This is not something you should ever need to do. If you restore back to original settings, then I guess that would throw away your own settings, but as I said, there should be no need to keep doing that. Or at all in fact.

  • What is the proper way to publish standard proxies/services using PI?

    Hello experts,
    Iu2019m working on a Project where we have an ECC 6.0 and we need to publish some standard services to external third-party applications. We found that the functionality that these third-party applications need is accomplished by the service MaintenanceRequestCreateRequestConfirmation_In of component ESA ECC-SE 603. As we are centralizing all our interfaces in SAP Process Intregration I have installed the ESA ECC-SE 603 XI content in SAP PI. After the installation, in tr. SPROXY transaction of the ECC system I can see the proxy properly implemented and ready to be called. And now I have to configure the interface in Integration Directoy. What I wonder is whatu2019s the best practice to configure this in PI? As I can see in ESR the service category is Inbound but, if Iu2019m not wrong, I have to publish a Outbound service? What should I do? Copy the entire definition to my own Software Component and create my own Outbound service? What is the proper way to publish standard proxies/services using PI?
    Thank you in advance.

    Using the Page Items to Submit property on the report region, the Refresh action is all that should be needed. I created a copy of page 2 on page 3, removed the Set Value action, and it is working as expected. I don't have access to 4.2.1 to try it on that specific patch level, but I've been using Page Items to Submit with a Refresh DA since 4.2.0 with no problems.

  • What is the proper way to reset a CoreTree's TreeModel?

    I have a senerio in which I need to clear out a CoreTree on an event - remove all roots and nodes and re-populate the CoreTree with new data.
    I've tried to nullify the CoreTree's TreeModel.
    I've tried using the PathSet:
    PathSet pathSetTransact = this.getTransactTree().getTreeState();
    if(pathSetTransact != null){
    Set ks = pathSetTransact.getKeySet();
    ks.clear();
    Neither of these work.
    What is the proper way to reset a CoreTree's TreeModel?
    Thanks,
    --Todd
    Also, in your code snippet, root isn't even used?
    Message was edited by:
    jtp51

    OK.
    This just isn't working.
    Setting my CoreTree's TreeModel with an empty GenericTreeNode does not clear out the previously populated tree.
    What other path could I take to accomplish my goal?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • What is the proper way to change rowHeight? (possibly animate?)

    What is the proper way to change rowHeight for UITableView? I set tableView.rowHeight and do a [tableView reloadData]. Is this necessary? Also, is it possible to animate the height change? It is not a standard transition.

    Not a perfect solution for your animation question - but....
    in the function where you want to change the height
    WARNING PSUDO CODE
    //indexPath is the path for theCell you want to edit
    thePlaceThatYouStoreYourHeights[x] = aNewHeight;
    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop];
    and inside of - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath (NSIndexPath *)indexPath
    return thePlaceThatYouStoreYourHeights[indexPath.row];
    Basic flow
    1. Store new desired height somewhere
    2. Remove the cell deleteRowsAtIndexPaths
    3. UITableView paints the animation for the "remove" transition **see note
    4. Re-add the cell insertRowsAtIndexPaths (which subsequently kicks of a call to heightForRowAtIndexPath before animating)
    5. UITableView paints the animation for the "add" transition
    You do NOT need to call reloadData to get this to work.
    **note: an enum such as UITableViewRowAnimationNone does not exist (it should but it doesnt seem to). the docs for InsertRowsAtIndexPaths say "A constant that either specifies the kind of animation to perform when inserting the cell or requests no animation." however there are only 5 items in the UITableViewRowAnimation enum and UITableViewRowAnimationFade resolves to 0 - so passing NO will actually get you fade. Nor will it take nil.
    Hope this helps shed some light.

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • What is the best way to set up iTunes on our home network so all family members have access to all of our itunes library, even music we don't have on the cloud?

    I have five different people using 10 different apple devices on one itunes account in our family.  We have had trouble sharing.  What is the best way to set up itunes on our home network?  We have purchased music that sits on icloud, but we also have music we have imported from our previous cd library.  Our itunes program keeps crashing and dumping everyone's playlists.  So far we have all been using just the one desktop computer to sync to because we can't figure out how to share the same librarly and playlists on multiple computers in our home so devices can be synced at any location as well as playlists and purchases be made. 

    What is the best way to set up itunes on our home network? 
    One iTunes library per person.  One iTunes account per person.
    If people wish to share songs, they can make copies.
    When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated!

  • What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

    I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
    alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
    Thanks in advance. Been struggleing with this for days!

    When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
    Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
    There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
    However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
    Hope this helps.
    Marcos Kirsch
    Principal Software Engineer
    Core Modular Instruments Software
    National Instruments

  • What Is The Best Way To Set Up Kids iTouch To My iTunes?

    I have an iTouch set up with my iTunes music, movies and apps, but now I gave my kids each an iTouch.
    What is the best way to set up there account, should it be a unique account for each of them or should I put them under my account?
    They will be using my same iMac when they sync or update there iTouch, so will they need to log in under their name every time?
    Not sure what is the best way to set this up, they are both minors, i.e. no credit card.
    Thanks

    Better just your account for multiple devices. The only drawback is that the music will have to managed manually.
    Connect one of the iPods to your computer then launch iTunes. You should see the iPod under Devices on the left side of the iTunes window. Double click then you can name each iPod to keep them separate but only syncs to your iTunes account.
    Without knowing your Apple ID user name and password they would not be able to make purchases ergo no downloads you aren't aware of.
    How to use multiple iPods, iPads, or iPhones with one computer
    The kids are minors.. if they are under 13 years of age, according to Apple, they can't have their own accounts regardless.
    http://www.apple.com/legal/itunes/us/terms.html#GIFTS

  • What is the best way of setting up Family Sharing?

    I just bought my son an iPad Mini and I am trying to decide on what is the best way of setting it up for him. The one thing I do know is that I do NOT want all the content that is my iPhone 6 to pop up on his iPad Mini. I want his iPad to be used for his games and educational stuff and his own music. I don't mind setting up a family photo album and share photos with the family. So is the Family Sharing option the best way of doing this based on what I just mentioned? Do I set him up with his own Apple ID? If so will everything still be based off my account so he won't have to create his own iTunes Library?
    I always use iTunes gift cards to purchase music and content. Will I be able to continue to use them even if I want to put some new content on his iPad and not my iPhone? Do I enter in his Apple ID info. Can you restrict certain family members to just certain things for example you only want to share photos with one person whereas you might want to share your music with another family member?
    Any suggestions on the best way of setting this up would great!
    Thanks!

    Hi DVX100Shooter,
    Congratulations on getting your son a new iPad, I am sure he will enjoy it. 
    Family Sharing is one way of managing both purchases and content between members of a related group of people. Each member must have their own Apple ID. You can choose what music you wish to share with the family from your own account. See this article -
    OS X Yosemite: Share purchases with your family
    In particular the section titled Hide a purchase from other family members
    The music library on your son's iPad is separate from yours, but under Family Sharing you agree to pay for all purchases made through the iTunes store. If you wish to control what is purchased you can set up the Ask to Buy option for any family member under adult age in your location. See this article for details -
    Request and make purchases with Ask to Buy - Apple Support
    Gift cards may not be used for billing of purchases under family sharing, with the exception that a family member may use gift cards to purchase their own content. See this article for information about Family Sharing billing policies -
    Family purchases and payments - Apple Support
    The shared family photo album is available to all family members.
    Family Sharing - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

Maybe you are looking for

  • Write arrays into a text file in different columns at different times

    Hi,           I have a problem write data into a text file. I want to write 4 1D arrays into a text file. The problem is that I need to write it at different time and in different column (in other word, not only append the arrays). Do you have an ide

  • In Powerdesigner repository, can we limit access for any user to one particular model?

    Hi I have this requirement in Powerdesigner repository to setup a user and give him/her access to check in and check out only one model? In otherwords, when he logs into repostiory, he can't see any other folders except the folder that was assigned t

  • Cisco CTS-1300

    Looking for direction: We have been asked to install and calibrate a Cisco CTS-1300. This brand new (never unboxed) CTS-1300 has been sitting on the client premise waiting to be installed since 2014. The present software version on the system is 1.8*

  • InputOutput error when importing SCORM 1.2 compliant content in OLM

    I'm attempting to import SCORM 1.2 content (from UPK) in OLM and I continue to get the error "The content upload failed (InputOutput error)". We've tried it on 9ias, AS10g, all give the same error. We used the SCORM example from Oracle, replaced the

  • Difference between forms6i and 10g

    Is there a big Difference between forms6i and 10g? Can someone with 6i experience use forms 10g without problems? Thanks