Skip to content

Commit 7e6d987

Browse files
committed
Code comments improvements
1 parent 0a3aded commit 7e6d987

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
export const version = '0.1.0';
4+
export const version = '0.1.0-preview';

azure-functions-nodejs-extensions-servicebus/src/grpcClientFactory.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@ import * as protoLoader from '@grpc/proto-loader';
66
import path from 'path';
77

88
/**
9-
* Creates a gRPC client for a specified service defined in a .proto file.
10-
* This function loads the .proto file, constructs the service client, and returns it.
11-
* @param param0 - Configuration for creating a gRPC client.
12-
* @param param0.protoPath - Path to the .proto file defining the gRPC service.
13-
* @param param0.serviceName - Name of the service to create a client for.
14-
* @returns A gRPC client instance for the specified service.
9+
* Creates and returns a gRPC client for the specified service.
10+
*
11+
* @template T - The type of gRPC client to create, extends grpc.Client
12+
*
13+
* @param options - The configuration options for creating the gRPC client
14+
* @param options.protoPath - Path to the .proto file that defines the service
15+
* @param options.serviceName - Name of the service in the proto file
16+
* @param options.address - The server address to connect to (e.g., "localhost:50051")
17+
* @param options.credentials - gRPC channel credentials to use for secure communication (defaults to insecure)
18+
* @param options.grpcMaxMessageLength - Maximum message length in bytes for both sending and receiving gRPC messages
19+
* @param options.includeDirs - Additional directories to search for imported .proto files
20+
*
21+
* @returns A new instance of the specified gRPC client
22+
*
23+
* @throws {Error} When the specified service name is not found in the proto file
24+
*
25+
* @example
26+
* const client = createGrpcClient<MyServiceClient>({
27+
* protoPath: './protos/my_service.proto',
28+
* serviceName: 'MyService',
29+
* address: 'localhost:50051',
30+
* grpcMaxMessageLength: 4 * 1024 * 1024, // 4MB
31+
* });
1532
*/
1633
export function createGrpcClient<T extends grpc.Client = grpc.Client>({
1734
protoPath,

azure-functions-nodejs-extensions-servicebus/src/servicebus/azureServiceBusMessageFactory.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ const DEAD_LETTER_REASON_ANNOTATION = 'DeadLetterReason';
1616
const DEAD_LETTER_ERROR_DESCRIPTION_ANNOTATION = 'DeadLetterErrorDescription';
1717

1818
/**
19-
* Factory class for creating and caching Azure Blob Storage clients
20-
* following Azure best practices for client reuse and lifecycle management
19+
* Factory class for creating and processing Azure Service Bus messages Manager.
20+
*
21+
* This factory class provides methods to:
22+
* - Build ServiceBusMessage instances from model binding data in Azure Functions
23+
* - Convert between different message formats (AMQP, Rhea)
24+
* - Extract and decode message body content with proper type handling
25+
*
26+
* The factory handles all necessary transformations of message properties,
27+
* annotations, and content to ensure proper integration with the Azure
28+
* Service Bus messaging system.
2129
*/
2230
export class AzureServiceBusMessageFactory {
2331
/**

0 commit comments

Comments
 (0)