Run Multiple Methods at the same time

Hey Everyone,
So here is my dilemia. I have these three classes and two of them are subscribers to a middleware so when I call one of these classes to subscribe the code stops while the subscriber listens for the message. The problem is that the other class I have is the publisher and unless I want to run the publisher as a separate script I need to find a way to run it once the subscriber is listening. Some have suggested I use a callback but I am unfamiliar with how a callback would work. In Matlab when I use callbacks I still end up waiting for the subscriber to come back with a response so I am not sure this is the solution to my problem in Java.
I have a main method in a main class which calls methods in each of three classes however once it subscribes to the first one on the list it stops and waits for the subscriber to finish working. Does anyone have any suggestions of how to allow the subscriber to continue to listen but still return back to the main method and allow me to run the next subscriber and so on? Thanks for your help!!

You'll need some sort of multithreading. Whether you roll your own or there's some prepackaged tools out there you can use, I don't know, as I didn't understand your requriements very well.
http://java.sun.com/docs/books/tutorial/essential/threads/

Similar Messages

  • Can device run multiple encryptions at the same time?

    I have a G5 at home and I'm considering hooking up a new Airport Extreme to enable wirelsss access from my work laptop (WIN PC). I use a Netgear 54MBPS Wireless PC card WG511 v2 which supports 128bit encryption. Should this work with the mac APE and if so can I also run other encryption modes at the same time in future if needed. I will be connecting the APE to my cable modem and using one of the LAN ports to connect to the G5.

    Thanks Don, at this stage I'm only using the Netcomm wireless but maybe in future I might go for the iTV or add another computer.
    Rob

  • Running two methods at the same time

    Hi, I need to run a bubble sort and an insertion sort at the same time.
    How can I do this? Threads?

    It doesn't work when I put in the algorithms though.
    It works when I do this:
    Bubble class:
              for(int x=0; x<20; x++){
                    try {
                        Thread.sleep(0000001);
                   } catch (InterruptedException e) {
                        return;
                   System.out.println("yes");
              }Insertion class
              for(int x=0; x<20; x++){
                    try {
                        Thread.sleep(0000001);
                   } catch (InterruptedException e) {
                        return;
                   System.out.println("no");
              }but when I try it on an algorithm it doesn't do anything
    public void insercionDirecta(int [] a, int[] num){
              for ( int i = 1; i < a.length; i++ ){
                 int aux = a;
         int aux2 = num[i]; //coordenadas y
         int j = i - 1;
         while ( j >= 0 && aux < a[j] ) {
         a[j + 1] = a[j];
         num[j+1] = num[j];//
         j--;
         a[j + 1] = aux;
         num[j+1] = aux2; //
         try {
                        Thread.sleep(60000);
                        } catch (InterruptedException e) {
                        return;
         System.out.println("1");
         }]/code]
    I've tried different amount of milliseconds and it doesn't work....
    my run() is like this
         public void run()
              int [] a = {5,2,4,3,1};
              int [] num = {1,2,3,4,5};
              insercionDirecta(a,num);
    } any ideas?

  • Run invoke-command on multiple machines at the same time

    Hey all so I read that if I store my New-pssession in a variable then used that in my invoke-command it would run all computers at the same time.
    $a = Get-Content "C:\Users\cody-horton\Desktop\list.txt"
    $session
    for($i=0;$i -lt $a.Length;$i++){
    if(!(Test-Connection -Cn $a[$i] -BufferSize 16 -Count 1 -ea 0 -quiet)){
    Write-Host $a[$i] -foregroundcolor red
    else{
    $session = New-PSSession $a[$i]
    Invoke-Command -Session $session -FilePath "\\My computer\C`$\Users\public\Documents\zip folder.ps1"
    What exactly am I doing wrong I just need to run this script on multiple machines at the same time.
    Thanks.
    Edit: Also what would be the best way to close all the sessions thanks.

    Hi there,
    So what I think you are doing wrong here is that you are overwriting the value in $Session everytime you executed code inside for loop. try the below:
    $a = Get-Content "C:\Users\cody-horton\Desktop\list.txt"
    $session = @() #define this as an array
    for($i=0;$i -lt $a.Length;$i++){
    if(!(Test-Connection -Cn $a[$i] -BufferSize 16 -Count 1 -ea 0 -quiet)){
    Write-Host $a[$i] -foregroundcolor red
    else{
    $session += New-PSSession $a[$i] #add the new session to the array, at the end it will be a collection of sessions
    Invoke-Command -Session $session -FilePath "\\My computer\C`$\Users\public\Documents\zip folder.ps1" #I think the above one won't work..first you need to copy the script locally on the machine and then execute it#Why this won't work because of Second-Hop Authentication
    Have put comments where I edited your code.
    Hope this helps
    Knowledge is Power{Shell}. http://dexterposh.blogspot.com/

  • Can I run the currency translation for multiple years at the same time?

    Dear Friends,
    I set up currency translation on our BPC NW 7.0 system and it is working fine ONLY if I run it for any one year at a time. But if I select multiple years in the data package (FX Restatment) selection it only calculates for the first year in that selection.
    say if I run the data package for years: 2009, 2010, 2011, 2012, it only performs currency translation for the year 2009.
    Can I run the currency translation for multiple years at the same time ?
    Note: The year is determined from the YEAR property of the "Time" dimension
    appreciate any inputs,
    thanks

    You can run currency translation for multiple years.
    I think the problem it is actually related to how you are sending the parameter to currency translation script.
    Just review the script logic log and you will see with what parameters was called currency translation FXTrans.
    My expectation is that actually the script is called just with first year and that's the problem.
    Log of script logic you can find it into:
    C:\BPC|DATA\Webfolder\YourAppset\YourApplication\Private Publications\Users used to run logic\Temp
    Regards
    Sorin Radulescu

  • WDS 2012 R2 - Cannot PXE multiple clients at the same time

    Hello All,
    This is my first post on here so I apologize if this is the wrong place.  I work for a school district and we are implementing WDS 2012 R2.  We've been extremely satisfied with the speeds and ease of use through unattend files.  However, for
    the past month I've been looking for a possible answer to a problem that has plagued us from day one of implementation.
    So here's the problem:
    I have a stand alone WDS server which is not a domain controller and is not our DHCP server.  I have IP helpers and broadcast forwarders setup on the network.  As well as option 66 and 67 in DHCP.  So far so good right!
    Well that's partially right.  When we boot one client at a time to the WDS server.  Everything works as intended.  We can TFTP the necessary files from the WDS server.  Everything boots up and we're off and running.
    However, if we boot up two or more clients at the same time.  The WDS server never responds to the traffic.  The clients get their DHCP information.  They start the referral and download from the WDS server, but get no response.  I'm
    really hoping that someone on here would have some insight of something I can try.  I've about exhausted my list of peers and contacts.  They're all stumped as well and were smart enough to stay with 2008 WDS.
    I would prefer to stick with 2012 R2 since it's setup and working for the most part.  With only this one hiccup.
    Thanks in advance for any guidance!

    Hello Daniel,
    I appreciate the reply and apologize for taking so long to get back to this.   Things have been a little hectic over here.
    I have tried everything on this forum and I am still unsuccessful in PXE booting multiple clients at the same time.
    Multicast is enabled on the server, and it works for the clients.  However, as stated in the original post.  I cannot boot multiple machines at the same time.  I can start them from the image selection screen around the same time though.  So,
    that appears to be working fine.

  • Lightroom CC issues with multiple export at the same time

    Back before Lightroom updated to the CC version, I was able to use export presets to send 4 different versions of the photos I'm working on at the same time (A Full Size for client at certain size, full size for myself, web-sized with watermark and a thumbnail). Since updating to the CC version, I'm only able to start the export process on two of these versions before the system simply becomes crippled and I cannot even navigate through Lightroom without it chugging along.
    For reference, I'm running a 2014 rMBP with 16GB of RAM, LR is the only app open at the time and it's showing that I have roughly 6GB of RAM free when attempting this export.
    TL;DR: LR5 worked wiht multiple exports at the same time, but LRCC now chugs after 2 exports are started

    Re: "Selecting video in Messages, now starts Face time for video. Face time is one to one only."
    Apple "Messages" supports two different types of video conferencing. It's become more than a little confusing. If you (or the person on the other end) ONLY have accounts set up for Apple's "iMessage" service (associated with your Apple ID and "iCloud") you may see the video symbol, but when you click on it you will be connected via FaceTime which is limited a 1-to-1 video conference.
    However, if you have set up an AIM account in Messages (you may already have an AIM account ID if you once used iChat for video, audio and screensharing) and the person at the other end also has an AIM account you will be connected via AIM and will be able to do screen sharing and multi-person video conferences just like the old iChat, i.e. you'll have iChat Theater features, up to 4-way conferencing, etc.
    It can get very confusing if, for example, you've signed up for AIM using a .me or .cloud email address. But once you have it set up and learn to recognise the way Messages switches between AIM and iMessage all the old iChat features work just fine in Messages.

  • How can I install one app on multiple iPads at the same time?

    We have a volume purchasing account, but when purchasing an app we get multiple serial numbers that all seem to need to be entered individually. The iPhone config Utility will not sync multiple iPads at the same time. Am I missing something? This cannot be the method for mass deployment, it seem too complicated.

    You can do a  backup of you iPad then restore the backup to many devices.
    How to use multiple iPods, iPads, or iPhones with one computer
    http://support.apple.com/kb/HT1495
    Mobile Device Management Solutions for iOS
    http://www.apple.com/iphone/business/integration/mdm/
    http://www.apple.com/ipad/business/resources/
    "iOS mobile device management (MDM)
    With an unmatched breadth of features, a Self Service console forover-the-air (OTA) distribution of in-house and app store apps, and integration with Apple's Volume Purchase Plan (VPP), the Casper Suiteallows administrators to easily achieve the four major tenets of iOSmobile device management: Inventory, Configuration, Security Management, and App Distribution."
    http://jamfsoftware.com/products/casper-suite/

  • Can I export multiple folders at the same time, keeping the album structure

    I'm exporting all of my photos from 2010 so far. Is there a way to export multiple folders at the same time, while keeping the existing album structure? It seems that when I try it, iPhoto exports them all to the same folder.
    I really don't want to do this one album at a time, and here's why -
    I'd like to select all of the albums, then export, using the plugin, to WalMart so that I can order prints.

    Check out [iPhotoToDisk|http://www.iphototodisk.com/index.html]
    I'd like to select all of the albums, then export, using the plugin, to WalMart so that I can order prints.
    Why not upload to Walmart from iPhoto? Check out the first option here:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • Is there any version of Indesign that allows to open multiple instance at the same time

    I am using Indesign CS3 to generate the bulk reports automatically(programmatically) using Adobe indesign library . One of the key limitation to this tool is it allows to open only one instance at a time unlike word where multiple instances can be opened at the same time. Is there any adobe indesign too version desktop/server which allows to open multiple instances at the same time. Any help on is appreciated. Thanks.

    @PeterG
    You said "You might want to examine the End User Licensing Agreement (EULA) for  any prohibition against using these two instances at the same time with  the same license; the license does permit two installs for the same user  that are not used simultaneously." I thought that meant you had read the EULA. It's pretty unambiguous on that point.
    For everyone's edification about multiple installations and server use with a standard license here's the relevant text:
    2. Software License.
    If you obtained the Software and any required serial number(s) from Adobe or one of its authorized
    licensees and as long as you comply with the terms of this agreement, Adobe grants you a non-exclusive
    license to install and use the Software in a manner consistent with its design and Documentation and as
    further set forth below. See Section 16 for specific provisions related to the use of certain products and
    components, for example font software, Acrobat, After Effects, Adobe Presenter, Contribute, Adobe
    Device Central, Flash Player, Flash Builder, and Adobe Runtimes.
    2.1 Limited Use. The Software, or portions of the Software, may allow installation and use without a serial
    number. If so, you may install but not use such non-serialized Software on any number of Computers as
    part of an organizational deployment plan. Further, you may install and use such non-serialized Software
    on any number of Computers for demonstration, evaluation and training purposes only and only if any
    Output Files or other materials produced through such use are used only for internal, non-commercial and
    non-production purposes. You may not use such non-serialized Software after any applicable time-out
    period has ended, unless you input a valid serial number under Section 2.2. ACCESS TO AND USE OF
    ANY OUTPUT FILES CREATED WITH SUCH NON-SERIALIZED SOFTWARE IS ENTIRELY AT
    YOUR OWN RISK.
    2.2 General Use. You may install and use one copy of the Software only on the Permitted Number of your
    compatible Computers into which you enter a valid serial number.
    2.3 Distribution from Server. You may copy an image of the Software onto Computer file server(s) within
    your Internal Network for the purpose of downloading and installing the Software onto Computers within
    the same Internal Network for use as permitted by Section 2.1 and 2.2.
    2.4 Server Use. You may install the Software on Computer file server(s) within your Internal Network only
    for use of the Software initiated by an individual from a Computer within the same Internal Network only
    as permitted by Section 2.2. The total number of users (not the concurrent number of users) able to use the
    Software on such Computer file server(s) may not exceed the Permitted Number.
    By way of example, the foregoing does not permit you to install or access (either directly or through
    commands, data or instructions) the Software: (a) from or to a Computer not part of your Internal Network,
    (b) for enabling Web hosted workgroups or services available to the public, (c) by any individual or entity
    to use, download, copy or otherwise benefit from the functionality of the Software unless licensed to do so
    by Adobe, (d) as a component of a system, workflow or service accessible by more than the Permitted
    Number of users, or (e) for operations not initiated by an individual user (e.g., automated server
    processing).
    2.5 Portable or Home Computer Use. Subject to the important restrictions set forth in Section 2.6, the
    primary user of the Computer on which the Software is installed under Section 2.2 (“Primary User”) may
    install a second copy of the Software for his or her exclusive use on either a portable Computer or a
    Computer located at his or her home, provided that the Software on the portable or home Computer is not
    used at the same time as the Software on the primary Computer.
    2.6 Restrictions on Secondary Use by Volume Licensees. If the Software was obtained under an Adobe
    volume license program (currently known as Adobe Open Options) by any licensee other than an
    educational volume licensee, the second copy of the Software made under Section 2.5 must be used solely
    for the benefit and business of that volume licensee. For more information about secondary use by volume
    licensees, please visit our Web Site at http://www.adobe.com/go/open_options.
    There is also language stating that if you have a dual boot or other system capable of running more than one OS you will need a separate license for each platform if you want to run the software on more than one.

  • Is it possible to upload multiple files at the same time?

    Hi folks,
    It seems pretty trivial to implement a file upload item, but is there some way to allow selection (upload) of multiple files at the same time? Seems like this has probably come up before, but I didn't find much for solutions in my search. Any links or insight would be appreciated.
    Thanks!
    -Adam vonNieda

    Thank you both for your replies.
    @Manish - That does allow for multiple file uploads without refreshing the page, but does not allow for multiple file uploads at the same time.
    @Tony - That might be the way I end up going, although I probably should have been more specific. It would be really nice it there was a way to do a mutli-file select using the control or shift button like you can with a standard file selection dialog (if you want to copy multiple files, for example). Having a separate line for each file browser means there has to be a limit on the number that can be selected at the same time.
    Has anyone implemented a method of selecting multiple files at once, and hitting an upload button once to get them into the database?
    Thanks again Manish and Tony, very helpful.
    -Adam

  • Can you use sync on multiple computers at the same time? ie have someone else logged into your firefox account for you whilst you are also logged in

    I am trying to sign up to something but there is only a short window so was going to ask a friend to sign in at the same time using my account to try to sign up (with my password being saved into my firefox account)

    Hi. Yes, you can use Sync on multiple devices at the same time. I use it to keep my bookmarks in sync across my desktop and Android versions of Firefox.

  • Is there a way to delete multiple pictures at the same time from the iphone4s?

    Is there a way to deleter multiple pictures at the same time, from my iphone4s? I know how to delete one at a time. Thanks

    Open your Photos App > Camera Roll > At the top right corner you will see a rectangle with a right arrow, select that. Now you can select as many photos as you want and you can hit the red Delete button on the bottom right.

  • CRVS2010 - open multiple rpts at the same time, like sheets in a xls file ?

    Hi all,
    is that possible to open multiple reports at the same time, like sheets in a excell file ?
    Is that possible create tabs beside the MainReport tab ? or include reports in the Group Tree ? how can I do it ?
    The application is in asp.net with VS2010 and CR2010.
    The reports used to be in excell with three sheets and now we are migrating them to crystal reports, how can I create the report with those three sheets ?
    thanks !
    Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|Crystal Reports for Visual Studio 2010 Beta - read before posting;
    Edited by: Ludek Uher on Aug 31, 2010 7:33 AM

    I'll make the suggestion to the Program Management group.
    You may want to do a post to the [Crystal Reports Design|SAP Crystal Reports; forum and ask them how they's fake that sort of a requirement. E.g.; there may be some way to make this report look the way you want, but it will be best to ask the experts. Don't mention CRVS2010 as they don't support it and most likely you will not get an answer.
    Ludek

  • Can you opening multiple albums at the same time in Photo (not iPhoto)?

    When converting the iPhoto library to Photo most of the albums that were in place in iPhoto converted to albums in Photo . . . .but not all. Some were retained as events mainly those that were folders within an album. In order to move them to the right album I would like to have multiple albums open at the same time (side by side) so that I can make sure not to duplicate photos or move them to the wrong spot.
    I cant see how to do this, it seems that I can need to open one album and check phots and then close to look within and other and rely on memory. There must be a more efficient and accurate way to do this?

    All of the events in iPhoto were converted to albums and are located in the Folder titled iPhoto Event in the sidebar of Photos. 
    You can't open multiple albums at the same time.  You can create a smart album that will do essentially the same thing with the following criteria:
    Album is "A"
    Album is "B".
    The smart album will display all of the photos in those two albums.

Maybe you are looking for

  • Multiple Meter Reads on the same day and Billing

    Hi All, There is a requirement to hold all reads received from Customer/ Meter Reader etc even they these are received on the same day for e.g. schedule read could be received in the morning, followed by customer read through internet and then anothe

  • Bug in 5.1: cant open links to audio files in Safari anymore.

    Before, if click a link to an mp3 file in safari it would play it with the quicktime. After upgrade to 5.1 i see just a black page for about 30s (even no usual "downloading" wheel in upper corner), and then nothing. Connecting via 3G, but as said, be

  • Windows XP machine doesn't show up in finder

    How can I change this, and then allow screen sharing (We have 3 other computers, which are macs, and they work fine together).

  • Slow when iPod plugged in, fine when syncing

    When I plug my iPod (5G Video, 30GB) into my PC, iTunes suffers a major slowdown, using almost 100% of my CPU. As soon as it starts syncing files, everything goes back to normal. Any ideas/suggestions? Home-built   Windows XP   2.93GHz 1024MB RAM

  • Transferring Pages document to iWeb as a blog

    I have created a 3 page 'blog' in Pages 09 using 'Informal newsletter'; 'Photo collage'; and 'Insert 2 columns with sidebar' for successive sheets. I then tried to 'send to iWeb' using 'Pages' . A My blog icon appeared with Pages title & ipsum laurem