Skip to content

Commit

Permalink
Avoid making async for no net benefits
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jun 15, 2020
1 parent d8620e0 commit 26b6143
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sdk/eventhub/event-hubs/src/eventHubProducerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class EventHubProducerClient {
* @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
* @throws AbortError if the operation is cancelled via the abortSignal.
*/
async getEventHubProperties(
getEventHubProperties(
options: GetEventHubPropertiesOptions = {}
): Promise<EventHubProperties> {
return this._context.managementSession!.getEventHubProperties({
Expand All @@ -291,12 +291,13 @@ export class EventHubProducerClient {
* @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
* @throws AbortError if the operation is cancelled via the abortSignal.
*/
async getPartitionIds(options: GetPartitionIdsOptions = {}): Promise<Array<string>> {
const eventHubProperties = await this._context.managementSession!.getEventHubProperties({
getPartitionIds(options: GetPartitionIdsOptions = {}): Promise<Array<string>> {
return this._context.managementSession!.getEventHubProperties({
...options,
retryOptions: this._clientOptions.retryOptions
}).then(eventHubProperties => {
return eventHubProperties.partitionIds;
});
return eventHubProperties.partitionIds;
}

/**
Expand All @@ -307,7 +308,7 @@ export class EventHubProducerClient {
* @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
* @throws AbortError if the operation is cancelled via the abortSignal.
*/
async getPartitionProperties(
getPartitionProperties(
partitionId: string,
options: GetPartitionPropertiesOptions = {}
): Promise<PartitionProperties> {
Expand Down

0 comments on commit 26b6143

Please sign in to comment.