Re: Pattern for One-Entry-Multiple-Workers Problem
Stefan Schulz <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
Dan Creswell wrote: > So, I feel like I must be missing something because it looks to me like > you could achieve most of this with registerForAvailabilityEvent. > > Each worker interested would register for matches and would receive a > copy of the Entry in the event. It could then process the Entry and > write back a new Entry. Yes, that is what I thought. So does a worker receive a copy of the entry or does it have to take it (manually) after notification? In the first case, this would be fine for my problem, in the second, would the space guarantee, which entry the worker gets? As far as I understood the API, the event only returns the template provided and not the matching entry. Maybe I am wrong :) > (1) A worker on startup might need to use contents to check for any > work > pre-existing in the space prior to registration. > > (2) A worker might sometimes want to do contents if it's not seen any > events recently to ensure none have been lost. Yes, when doing a contents, checking and signing an entry becomes easy (take it, unmarshall it, test it, eventually process and sign it, marshall it, write it back). Thanks, Stefan =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff JAVASPACES-USERS". For general help, send email to [email protected] and include in the body of the message "help". To view past JAVASPACES-USERS postings, please see: http://archives.java.sun.com/archives/javaspaces-users.html JDC members can download the JavaSpaces(tm) Technology from: http://developer.java.sun.com/developer/products/jini/