[ 
https://issues.apache.org/jira/browse/LANG-560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oliver Heger updated LANG-560:
------------------------------

    Attachment: TimedSemaphore.patch

Patch including the {{TimedSemaphore}} implementation and a unit test.

The test makes use of EasyMock, therefore this dependency is added to the pom.

> New TimedSemaphore class
> ------------------------
>
>                 Key: LANG-560
>                 URL: https://issues.apache.org/jira/browse/LANG-560
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Oliver Heger
>             Fix For: 3.0
>
>         Attachments: TimedSemaphore.patch
>
>
> {{TimedSemaphore}} is a specialized Semaphore implementation that also has a 
> timing component: In a configurable time period a given number of permits is 
> available. Threads call the semaphore's {{acquire()}} method to request a 
> permit. When no more permits are available {{acquire()}} blocks the calling 
> thread. At the end of the time period the permits are restored, and all 
> blocking threads are waked up.
> The main use case for this class is to provide a convenient means for 
> controlling the load produced by a process. When used correctly, 
> {{TimedSemaphore}} ensures that only a given number of steps (e.g. database 
> queries, file operations, or computations) are performed in a specific time 
> period. This may be useful for many applications.
> More information including a usage example can be found in the Javadocs of 
> the class. Comments or suggestions for improvements are appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to