Best approach for a Service that runs on a queue of entry requires an asynchronous operation

I have some sort of a queue of requests to which I am able to add news from various parts of the application.

My JavaFX-Service must then process these requests asynchronous, but coordinated way.

My current approach is to use an ObservableList for the queue. I have a listener on its emptyProperty and trigger restarting the service whenever it not pass of the vacuum to the vacuum.

In the task of my service, I take the first element of the list, treat it and when the treatment has passed (or omitted), delete the list.

Then, however I have to check in the succeeded() and failed() methods if there are more items and restart the service in the event that there are.

It feels unnecessarily complicated and potentially error-prone. Is there not an approach more simple I'm missing?

Oh cool, the simulation of greed, thanks for the link that James.

Tags: Java

Similar Questions

  • Best approach for the design of the Radial Image - sector scanning Sonar

    This is not a problem, but you are asked to think about the best approach.

    I need a sector sonar image data.  This device runs on 360 (degree sub-segments) and generates a set of data from the origin - radially outwards at an angle of no - to an endpoint.  Therefore, for each 'ping' sonar I need data points in the center of a circle graph, a radial angle on the outside.

    I don't know if I should use LabView vi for the drawing tools, or go to ActiveX or?

    Anyone has a suggestion on the best approach to this?

    Thank you
    Peter

    Peter,

    You can use a chart of the LabVIEW intensities for this kind of display.

    Maybe not the best way, but it is possible.

    As an attachment, I did an example with your specifications.

    datapoints 1024 by degree

    See example image:

    Basic principle:

    -Create the matrix of 2048 x 2048 points database

    -For each 'line of angle' calculate which pixel to replace each data point in the line

    -Because "datapoints" becoming bigger, far from the Center, repeat the action for several "sup angles. for example, to 85 deg also Calc. 84.6, 84.8, 85, 85.2 85.4

    It gives you an idea of the possibilities, but performance may be necessary.

    -Only external Calc x pixels more degrees

    -Do some kind of anti-aliasing to avoid the pixelated lines.

    See attached example. (LV 8.6)

  • services that run via scheduled task

    Hi all

    I am creating a task scheduled to start/stop services. the scheduled task must be run under the service account with minimal rights, as rights of the user or the user rights of maximum power.
    I created the scheduled task running under the account of service with power user rights to stop a service, but unfortunately the task was doing what it suppose to do.
    I did some troubleshooting and investigated as shown below:
    1. I used the runas command to run net stop under the service account that runs the scheduled task, the service is stopped, as it is assumed
    2. I connect to the server using the account service and disconnected (the session will be shown in the disk for the service account) and at the same time open a session to the server with a different account performed the scheduled task, the task does what it is supposed to do. (the service is stopped)
    Note: the scheduled task is set to enabled (scheduled task to run at a specified time)
    3 when I changed the rights on behalf of rights of administrator power user rights service and perform scheduled task, the task runs correctly and does what he must do.
    4. the service was set to be managed by the user with power, which means that if a user opens a session on the server and try to start/stop the service, he will be able to action and is successful.
    my questions will be as shown below:
    1. to start/stop the service via a scheduled task, the service account needs a session to be able to perform the task?
    2 must. the service account the highest privileges to perform the task?
    3. is there a way to avoid to run the scheduled task to run with minimum privileges? What kind of things need to be done.
    Thanks in advance for your answer.

    I would look at the link below.  This should answer all these questions.

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/sag_tsconcepts03.mspx?mfr=true

  • best approach for lists of type template shows specific?

    Hi, I want to get a list of rooms only in a specific pattern.  I'm curious to know if I need to use PHP scripts or actionscript.

    By examining the actionscript, I heard that it is not necessarily as safe as the .swf could potentially be decompiled and account identification information.  in the review of PHP, it "would cost" more time as a HTTPService call would be necessary as the user having to wait for the server to connect to the account (However, this currently the approach I'm leaning towards since I write for a DB on the creation of space in any case)

    What would be the best practice for a list of the rooms IN a SPECIFIC MODEL?  If the answer is PHP, could someone provide an example of how analyze table returned to get only a specific model type?  I'm a little confused on how to access specific nodes of the... $list = $am-> listRooms();... Thanks in advance!

    It is an example of using AFCSAccount-> listRoom():

    $am = new AFCSAccount ($accountURL);

    $am-> login ($username, $password);

    echo "= room for {$accountName} list = \n";

    {foreach ($am-> listRooms() as $r)

    echo "{$r-> name}: {$r-> desc}: {$r-> created-> format (DATE_RFC822)} \n";

    }

    You would need to look at the rooms where $r-> desc is "name of the model. Currently we do not provide a filter for this, but I understand how this would be useful.

    The alternative is since you manage a database and use it to create space, you must store the information of the model here for quick recovery. Again, the way we store information room is designed for quick access to specific rooms, but not for questioning possibly long list of rooms.

  • What is the best approach for a same code used for 16 test stations

    I write code for 16 testbeds that are all the same, except that different circuits CAN are used, i.e. CAN0 through CAN15. The approach that I plan to use is 16 screws, one for each test station executes independently and in parallel, meaning that they can be stopped and started at different times. Each of the 16 screws have about 10 complex subVIs that are all the same. Even if I do not use uninitialized shift registers, I wonder if there is no advantage to using a reentrant approach, or even if it works for my application. Any suggestions are appreciated as I have no experience using the reentrant approach.

    Thank you.

    First of all, you should get used to use projects. They are very useful. If the code is in a project, you can open the VI from there.

  • Pay for a service that are not not on my account

    I cancelled my subscription to Adobe Illustrator CC some time ago, and it does not appear under "Plans & Products" on my account. It says I have no plans or products, and the program is no longer installed on my PC. However I am still being billed $19.99 a month for the service. Also because my account says I have more the program I can't contact Adobe chat or by telephone to the customer service. I tried the steps 'Cancel the annual subscription' in the "still need help? Contact us"button, which brings me directly on the forums instead of asking me to sign.

    Help, please!

    Have you ever used another email address, and could you have bought something using this e-mail?

    phone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Best approach for tp UCM Content Migration

    Hello
    We are migrating to the Complutense University of MADRID. It's about 80% of web content and static files of 20%.
    And we have about 30 k of content items. Please suggest various approaches to this and please tell best one that goes on the above requirement.

    Thank you...

    Hello!
    One way or another, you must download your file and assign metadata to it. There are a few ways to do this:
    1 Batchloader
    Create files in a specified format, specifying the paths and metadata of a batch of documents. Once you run your batchloader, the documents will be archived

    2 IdcClient
    An OCX you can put in your VB / C#-program of running services on your server-UCM

    3 IdcCommand
    A utility command line for execution of the services

    4 WebDAV
    Copy a tree of files directly on your server. The drawback here is that you lose control over your metadata - but you can change it later.

    / Sam

  • KB3057839 breaks the windows services that run the GUI programs

    For reasons of inheritance, one of our tracks to windows service applications a 3rd party tool which is a graphical application in general. but also has command line switches to run in batch mode. The 3rd third party provider does not (and will not) provide a lot of command line application that is stand-alone/separated from the GUI, which leaves us with no alternative at the moment.

    So far, this approach has worked on Windows 7, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 - regardless of the registry setting 'NoInteractiveServices' in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows.

    But since the installation of the KB3057839 (which relates to the MS15-061) this approach has stopped working and caused the application GUI stuck, to consume 100% of one heart. The only way to get the old behavior is the following:

    1. Change NoInteractiveServices to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows to the value '0' (Windows 8 and later versions; Windows 2012 and later only)
    2. Start the UI0Detect Service ("Interactive Service detection"), defining eventually it starts automatically. and according to the other settings the same set up a recurring task to restart the service (because it stops after a while).

    As soon as UI0Detect is running, the application GUI thaws and works as expected; but also long UI0Detect is running. And since the application GUI does not in fact all the message boxes or similar which require user input, this is the kind of a workaround longshot.

    Uninstallation of KB3057839 Gets the old behavior back, but I doubt that this should be the recommended way of going. And after a search, users also have many problems with this patch.

    We checked on a virtual machine that has been reset to a snapshot prior to installation (where the intended behavior is always given); installation of KB3057839 breaks, and arranges the uninstallation of KB3057839 once again.

    Is this behavior with the installation of KB3057839, or is it a bug/pervert of the fix MS15-061 effect?

    Thanks to Ståle L. Hansen

    KB3070102 (exit 14. July 2015) replaces KB3057839 and will most likely solve your problems.

    KB3070102 / MS15-073: vulnerability in the Windows kernel-mode driver could allow elevation of privileges
    https://TechNet.Microsoft.com/library/security/MS15-073
    https://support.Microsoft.com/kb/3070102

  • Limit the software and Services that run in the Service Console in ESXi 4.0?

    How to limit the software and Services running in the Services Console in ESXi 4.0?

    Hello.

    There is no Service in ESXi Console, and it is not really a lot of apps for ESXi either. Policy and/or limited access is the best way to limit these things.

    Good luck!

  • Best practices for backup service console configuration

    Hello

    When you install our ESX servers, I did what I thought was best practices and created a "backup" vswitch with a second service console. Two service consoles have IP addresses on the same subnet.

    They work very well for several weeks. But today, I had a problem connecting to the consoles of the virtual machines on one of our ESX host. After much troubleshooting, I found doc below...

    http://KB.VMware.com/selfservice/viewContent.do?language=en_US & externalId = 749640

    In point 8, it is said to make sure that you do not have 2 consoles of service on the same network. (Either by the way once I removed the backup vswitch I could access the consoles.)

    I so wanted to check this - should I not create these backup service consoles?

    TIA,

    H

    You don't have to second service console, just a second link to SC.

    Add a NIC to portgroup SC (it can be standby NIC), which would be enough.

    ---

    VMware vExpert 2009

    http://blog.vadmin.ru

  • Best practices for the services-config ADEP

    I need to develop a services - config.xml to connect to my project of the ADEP LCD screens.  Are there best practices I should be informed regarding the ADEP / interaction of LCDs in that regard?

    Thanks in advance!

    Hi Mike. You can use the CRXDE Lite Editor to modify the services - config.xml for a Data Services application that is deployed on the server of the experience.

    When you're in CRXDE Lite, go to:

    / etc/ASP/config/dataservices/services-config. XML

    Open the services - config.xml, make your changes and click Save all.

    After that, when you create a new 'Flex for ADEP experience Services' project in Flash Builder, the channelset-config information is copied in the services - config.xml in a config.xml file file - channelset is added to the directory of your Flex dataservices project and is also added to your project mxmlc compiler options.

  • Some advice needed for the client that runs on Windows xp

    Hi all

    I'm looking for some advice for a project, I am working currently on, what I need to do is to build a client that will run on windows as a service/calendar is connected to a local instance of the database to collect data from all tables of maximum size of the data would be 256 kb and analyze to a web service. Customers are located behind the corporate firewall to which I have no access. Could someone advise me on what type of client, I need to develop to achieve this goal.

    concerning Martyn

    Martyn says:
    If I created a jar file, would I be able to run it in the background say once a week

    Yes.

    Once I've collected data through JDBC, I thought that analysis of the data to a web service

    What is 'analysis of the data to a web service? If you mean send data using web services, then Yes, you can do.

  • How to use the script "click menu item" command on a menu item for an application that runs under another user?

    Hey everyone, quick question...

    I am trying to run this script:

    say application "System events".

    say process of "iTunes."

    click on menu item "Start Station" from the menu 'Song' to menu bar item 'Song' in the menu bar 1

    end say

    end say



    The idea behind this is to start a song selected currently playing station. I know, it's not hard to do it manually, but I want to be able to do it without having to call the iTunes app to the front. Now, this script works for my own iTunes app, but I have a second instance of iTunes connecting the second user on my computer at home (User2), with its own separate library and account and all. script I have works fine for an instance of iTunes under my user account, but I can't figure out how to specify which instance of iTunes, I'd like the script to work on.




    I want to emphasize as an FYI that i use.


    the shell script "connection f User2 /Applications/iTunes.app/Contents/MacOS/iTunes > & - 2 > & - &" with administrator privileges

    -to open my second instance of iTunes as User2



    is there a way to change the "process"iTunes"to say" something like 'process 'unix ID' say' and have the ID for each respective instance of iTunes unix?


    Let me know if I do not make sense... Thanks in advance to anyone who can help






    You can target a process of application using various properties of system events, for example:

    tell application "System Events"
      tell first item of (get application processes whose unix id is 15174) -- or whatever id
        activate --> needed when using GUI scripting
        get properties
      end tell
    end tell
    
  • Is it possible to configure the same user for 500 systems that run under XP & Win7?

    Hello

    About 500 systems are run under Windows XP & Windows7, is it possible to use the same user for all 500 systems?

    Hi SupportRI,

    Windows Live family safety is no longer manages the accounts of children using Windows Live ID Windows Live ID on behalf of the child is essentially used for the feature of managing contacts (restrictions on the use of Hotmail and Messenger). Currently, parental control can manage Windows users; However, if you have already configured a Windows Live ID account before the update, it will be always available. You can see the thread below for more information.

    Where is the function of the safety Contact family management?

    If you intend to use Windows Live Family Safety for all users of 500 to restrict the Internet connection, please note that parental control does not restrict the Internet and Web sites. You also have the option in the list of content filtering Web to apply the rules to all users under the Family Safety.

    For more information on how you can install Windows Live Family Safety, please visit the link below.

    Protect your kids with parental controls

    Thank you!

  • What is the best laptop for video editing that task my money?

    Hello

    I have Lenovo laptop, I used it for 5 years, until now, I see that it is not good enough to make the work of video editing. So now I think to buy a new laptop for this case, but I am not confident about my knowledge on the area of the laptop. Everyone here knows or has a good knowledge on laptop, please give me a serious opinion, thank you.

    Hi jespong,

    Thanks for posting.

    The first starting point would be to look at the minimum specifications required by the video editing program, and then start looking for laptops with these specifications.  Then look for those that have the best specifications requested by the program and settle for something in between.

    According to your budget, it would be better to buy something that has more than request the program you always want to have the best.

    Kind regards

    Robert

Maybe you are looking for

  • Missing 'messages' entry in the VIEW menu

    I use TB version 31.2.0 as is a friend who does not see the entry of 'messages' in the VIEW menu.They see sort by and Threads but no message.I have and they do not. Can someone point me in the direction of a cause or solution? Thank you Dorothy

  • Still, IMovie does not not 10.1.1

    Although having desinstalled 10.1.1 Imovie which did not work anylonger since this new version 10.1.1 and reinstalled a 10.1 previous who has worked in Imovie is not more usable. I can't create any project or the whole movie. Who could help me on thi

  • DVD drive is not burning DVDs

    Help, please! I bought a writer of CD/DVD Toshiba SD-R5372 a couple of months. I had it installed by a pc repair shop. When I gathered my computer that they don't give me not all discs pilot etc... for the product. They say now that they do not have

  • How can I download my pictures from my mobile phone?

    I plugged my usb cable from my cell phone and on my pc, but nothing happens. I'm trying to transfer my photos from my cell phone. Help, please.

  • Close the laptop and continue to work with external monitor

    Hi, I just bought a laptop HP15 and I want to work with an external monitor, keyboard, and mouse, but I have no space in my office for monitor and notebook open. The point is that when I close the laptop being the PC on, it shuts down suddenly and I