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

added ability to override visibility_timeout (default 30 seconds) #126

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 5.2.12 - 2023-01-02
## 5.2.12 - 2024-01-03
### Changed
- Added ability to override **visibility_timeout** for QueuePoller

## 5.2.12 - 2024-01-02
### Changed
- Updated dependencies

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
pheme (5.2.12)
pheme (5.2.13)
activesupport (>= 4)
aws-sdk-sns (~> 1.1)
aws-sdk-sqs (~> 1.3)
Expand Down
3 changes: 3 additions & 0 deletions lib/pheme/queue_poller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def initialize(queue_url:,
poller_configuration: {},
6 marked this conversation as resolved.
Show resolved Hide resolved
sqs_client: nil,
idle_timeout: nil,
visibility_timeout: nil,
message_handler: nil,
&block_message_handler)
raise ArgumentError, "must specify non-nil queue_url" if queue_url.blank?
Expand All @@ -28,10 +29,12 @@ def initialize(queue_url:,
@poller_configuration = {
wait_time_seconds: 10, # amount of time a long polling receive call can wait for a message before receiving a empty response (which will trigger another polling request)
idle_timeout: 20, # disconnects poller after 20 seconds of idle time
visibility_timeout: nil, # amount of time in seconds to process and delete the message before it is added back into the queue
skip_delete: true, # manually delete messages
}.merge(poller_configuration || {})

@poller_configuration[:idle_timeout] = idle_timeout unless idle_timeout.nil?
@poller_configuration[:visibility_timeout] = visibility_timeout

if message_handler
if message_handler.ancestors.include?(Pheme::MessageHandler)
Expand Down
2 changes: 1 addition & 1 deletion lib/pheme/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pheme
VERSION = '5.2.12'.freeze
VERSION = '5.2.13'.freeze
end