• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple instances and background batch threads.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple instances and background batch threads.


  • Subject: Re: Multiple instances and background batch threads.
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 9 Oct 2008 11:15:38 -0700


On Oct 8, 2008, at 6:03 PM, Miguel Arroz wrote:

Hi!

We have some "request" entities to handle communication between real apps and the helper apps. The real app creates a request object and stores it on the DB. Helper apps check the DB every 5 seconds or so for unprocessed requests. I've found some advantages on this:

- If processing goes wrong, you can store information about the error on the request itself and mark it as being in error state. That helps tracking down problems.

- It can be used to establish priorities, like sorting the requests for some kind of priority rules and always picking up the highest priority one.

- We still haven't made this, but theoretically it's an easy way to load-balance tasks, if that is needed, across multiple instances. As you have full control over the semantics of the requests, you can launch several instances with different configurations (maybe using command line arguments) and each instance can be smart enough to process only the requests that should be processed by it. This solves the problem of load balancing *and* making sure you don't have more than one instance making raw processing on the same data, as you would control that. Again, this paragraph is only theoretical, there may be something fundamentally wrong with this that I'll only find out when implementing, but it seems a great idea. ;)

That is how I have mine set up. I have not gotten to the point of partitioning some of the threads into a second instance, but it is setup to handle it.


Chuck



On 2008/10/09, at 01:40, Josh Paul wrote:

+1

We have a DirectAction that allows for apps to call in when the process(ing) is needed.

On Oct 8, 2008, at 5:11 PM, Chuck Hill wrote:

So far that has worked for me as well.

Chuck

On Oct 8, 2008, at 5:00 PM, Miguel Arroz wrote:

Hi!

We have separate applications that handle that kind of tasks. Each of those applications will have only one instance running. No locking needed, no database channel congestion on "real" application instances, etc.

Yours

Miguel Arroz

...........................
http://www.survs.com


On 2008/10/09, at 00:49, Q wrote:

I have a scenario where I need my application to periodically fire off background batch tasks in a separate thread, but only need one of the possible instances to perform this task at any given interval. What technique do people normally use with WO to perform this sort of election/locking between instances so that only one of them at a time ever attempts to do the work?


-- Seeya...Q

Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Multiple instances and background batch threads. (From: Q <email@hidden>)
 >Re: Multiple instances and background batch threads. (From: Miguel Arroz <email@hidden>)
 >Re: Multiple instances and background batch threads. (From: Chuck Hill <email@hidden>)
 >Re: Multiple instances and background batch threads. (From: Josh Paul <email@hidden>)
 >Re: Multiple instances and background batch threads. (From: Miguel Arroz <email@hidden>)

  • Prev by Date: Re: Open page in a popup window
  • Next by Date: Hyperlink and saveChanges
  • Previous by thread: Re: Multiple instances and background batch threads.
  • Next by thread: Re: Multiple instances and background batch threads.
  • Index(es):
    • Date
    • Thread