Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function args type #516

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
008e401
polling instrumentation callbacks
MoshikEilon Nov 14, 2019
081e6c1
remove dist from gitignore
MoshikEilon Nov 14, 2019
775472f
bump version
MoshikEilon Nov 14, 2019
53cc6e0
polling instrument null check
MoshikEilon Nov 19, 2019
aba3ab7
update version
MoshikEilon Nov 19, 2019
c22643e
build ts
MoshikEilon Nov 19, 2019
052af91
update version
MoshikEilon Nov 19, 2019
697c58d
add message uuid to errors
MoshikEilon Nov 24, 2019
351362a
bump version
MoshikEilon Nov 24, 2019
8894a2c
remove lodash
MoshikEilon Nov 24, 2019
a88d7bc
update version
MoshikEilon Nov 24, 2019
d471514
update version
MoshikEilon Nov 24, 2019
3de9bcc
current owrk
May 18, 2020
8450568
Merge pull request #1 from DaPulse/feature/ran/sqs-multiple-concurrency
RanNir143 May 18, 2020
cc79c01
timeout for batch size zero
May 19, 2020
eecc743
upgrade version
May 19, 2020
33a4a88
Merge pull request #2 from DaPulse/feature/ran/add_timeout_for_zero_b…
RanNir143 May 19, 2020
63284d7
review fixes
May 20, 2020
4ccc15d
increment minor version
May 20, 2020
b40b69d
yarn build
May 20, 2020
6cf35c1
Merge pull request #3 from DaPulse/feature/ran/review_fixes_new_sqs_i…
RanNir143 May 20, 2020
2e8c900
addition of data in instrumentation and version upgrade
May 20, 2020
523ce77
Merge pull request #4 from DaPulse/addition/ran/missing_function_call…
RanNir143 May 20, 2020
57c2e17
add setters for concurrency props
Mar 24, 2022
e75309d
check non existent queue error and throw
Mar 24, 2022
3a9a413
Merge pull request #8 from DaPulse/feature/moshik/add_throttling_options
MoshikEilon Mar 24, 2022
4d4eca7
bump version
Mar 24, 2022
12a4030
Merge remote-tracking branch 'origin/master' into feature/moshik/add_…
Mar 24, 2022
997655b
Merge pull request #9 from DaPulse/feature/moshik/add_throttling_options
MoshikEilon Mar 24, 2022
2b2b49e
add queue url to error events
Apr 10, 2022
b604213
bump major version
Apr 10, 2022
6efd3b4
Merge pull request #16 from DaPulse/feature/moshik/add_data_to_error_…
MoshikEilon Apr 10, 2022
647e2a2
add queueUrl to all emitted events data
Apr 10, 2022
df63e73
Merge pull request #18 from DaPulse/feature/moshik/pass_queue_url_on_…
MoshikEilon Apr 10, 2022
f8fac8f
bump version
Apr 10, 2022
90132aa
Merge pull request #19 from DaPulse/feature/moshik/pass_queue_url_on_…
MoshikEilon Apr 10, 2022
737c075
add setter to polling wait time ms
Apr 19, 2022
f6d4444
Merge pull request #20 from DaPulse/feature/moshik/add_polling_wait_t…
MoshikEilon Apr 19, 2022
f995fc7
Pin aws-sdk to 2.1547.0
shaikatzz Jun 20, 2024
497d1cb
Merge pull request #27 from shaikatzz/patch-1
MoshikEilon Jun 23, 2024
0b2eed7
aws-sdk pin to 2.1491.0
shaikatzz Jun 24, 2024
b1b3c63
Merge pull request #28 from shaikatzz/patch-2
MoshikEilon Jun 24, 2024
3467030
aws-sdk pin to 2.1490.0
shaikatzz Jun 24, 2024
ff7a5a2
Merge pull request #29 from shaikatzz/patch-3
MoshikEilon Jun 24, 2024
78c6345
make error optional
Goralt Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
test.js
coverage
dist
# dist
.nyc_output
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": true
}
1 change: 1 addition & 0 deletions dist/bind.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function autoBind(obj: object): void;
15 changes: 15 additions & 0 deletions dist/bind.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
function isMethod(propertyName, value) {
return propertyName !== 'constructor' && typeof value === 'function';
}
function autoBind(obj) {
const propertyNames = Object.getOwnPropertyNames(obj.constructor.prototype);
propertyNames.forEach((propertyName) => {
const value = obj[propertyName];
if (isMethod(propertyName, value)) {
obj[propertyName] = value.bind(obj);
}
});
}
exports.autoBind = autoBind;
71 changes: 71 additions & 0 deletions dist/consumer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import * as SQS from 'aws-sdk/clients/sqs';
import { EventEmitter } from 'events';
declare type SQSMessage = SQS.Types.Message;
export interface ConsumerOptions {
queueUrl?: string;
attributeNames?: string[];
messageAttributeNames?: string[];
stopped?: boolean;
concurrencyLimit?: number;
batchSize?: number;
visibilityTimeout?: number;
waitTimeSeconds?: number;
authenticationErrorTimeout?: number;
pollingWaitTimeMs?: number;
msDelayOnEmptyBatchSize?: number;
terminateVisibilityTimeout?: boolean;
sqs?: SQS;
region?: string;
handleMessageTimeout?: number;
handleMessage?(message: SQSMessage): Promise<void>;
handleMessageBatch?(messages: SQSMessage[], consumer: Consumer): Promise<void>;
pollingStartedInstrumentCallback?(eventData: object): void;
pollingFinishedInstrumentCallback?(eventData: object): void;
batchStartedInstrumentCallBack?(eventData: object): void;
batchFinishedInstrumentCallBack?(eventData: object): void;
batchFailedInstrumentCallBack?(eventData: object): void;
}
export declare class Consumer extends EventEmitter {
private queueUrl;
private handleMessage;
private handleMessageBatch;
private pollingStartedInstrumentCallback?;
private pollingFinishedInstrumentCallback?;
private batchStartedInstrumentCallBack?;
private batchFinishedInstrumentCallBack?;
private batchFailedInstrumentCallBack?;
private handleMessageTimeout;
private attributeNames;
private messageAttributeNames;
private stopped;
private concurrencyLimit;
private freeConcurrentSlots;
private batchSize;
private visibilityTimeout;
private waitTimeSeconds;
private authenticationErrorTimeout;
private pollingWaitTimeMs;
private msDelayOnEmptyBatchSize;
private terminateVisibilityTimeout;
private sqs;
constructor(options: ConsumerOptions);
readonly isRunning: boolean;
static create(options: ConsumerOptions): Consumer;
start(): void;
stop(): void;
setBatchSize(newBatchSize: number): void;
setConcurrencyLimit(newConcurrencyLimit: number): void;
setPollingWaitTimeMs(newPollingWaitTimeMs: number): void;
reportMessageFromBatchFinished(message: SQSMessage, error: Error): Promise<void>;
private reportNumberOfMessagesReceived;
private handleSqsResponse;
private processMessage;
private receiveMessage;
private deleteMessage;
private executeHandler;
private terminateVisabilityTimeout;
private emitError;
private poll;
private processMessageBatch;
}
export {};
Loading
Loading