Issue Details (XML | Word | Printable)

Key: GROOVYRTM-2
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: eric.wendelin
Reporter: eric.wendelin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovyrtm

GroovyRTM does not enforce minimum delay properly with more than 2 calls

Created: 26/Aug/09 05:46 PM   Updated: 29/Dec/09 10:15 PM   Resolved: 26/Sep/09 05:06 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Original Estimate: 6 hours
Original Estimate - 6 hours
Remaining Estimate: 6 hours
Remaining Estimate - 6 hours
Time Spent: Not Specified
Time Spent - Not Specified

Tags: concurrency


 Description  « Hide

When more than 2 successive calls to the RTM API occur on different threads, GroovyRTM will not enforce the 1 second delay rule.

Some kind of request queue is needed that enforces the API rule of 1 call per second.



eric.wendelin added a comment - 01/Sep/09 07:08 PM

This problem only occurs with multi-threaded applications. Otherwise everything executes on the EDT enforcing the delay.


eric.wendelin added a comment - 14/Sep/09 07:42 PM

Synchronized the enforceDelay() method so that multiple threads can't execute RTM methods concurrently. Not going to turn RtmService into a singleton for this, though.


eric.wendelin added a comment - 19/Sep/09 05:07 PM

Turns out the solution does not work in all cases. Re-opening to see what else either needs fixing.


eric.wendelin added a comment - 26/Sep/09 05:06 AM

Synchronized on the object that keeps track of the last time of a call to RTM. Added a test case to ensure this works.