/*! Copyright 2019 Ron Buckton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. THIRD PARTY LICENSE NOTICE: Semaphore is derived from the implementation of Semaphore in Promise Extensions for Javascript: https://github.com/rbuckton/prex Promise Extensions is licensed under the Apache 2.0 License: Promise Extensions for JavaScript Copyright (c) Microsoft Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import { Cancelable } from "@esfx/cancelable"; /** * Limits the number of asynchronous operations that can access a resource * or pool of resources. */ export declare class AsyncSemaphore { private _maxCount; private _currentCount; private _waiters; /** * Initializes a new instance of the Semaphore class. * * @param initialCount The initial number of entries. * @param maxCount The maximum number of entries. */ constructor(initialCount: number, maxCount?: number); /** * Gets the number of remaining asynchronous operations that can enter * the Semaphore. */ get count(): number; /** * Asynchronously waits for the event to become signaled. * * @param cancelable An optional Cancelable used to cancel the request. */ wait(cancelable?: Cancelable): Promise; /** * Releases the Semaphore one or more times. * * @param count The number of times to release the Semaphore. */ release(count?: number): void; } //# sourceMappingURL=index.d.ts.map