This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Task Supervisor for message consumers #179
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ccc0367
Initial attempt at using a Task Supervisor for message consumers
akoutmos 994625f
Adjusting testing travis matrix
akoutmos c360540
Remove unnecessary task supervisor start
akoutmos db0b2aa
Added telemetry event for failed task and adjusted :DOWN function to …
akoutmos d5698e5
Added ability to yield for running tasks during GenServer termination
akoutmos fb685b8
Added tests for Task Supervisor await
akoutmos 2f3313e
Fixing credo error
akoutmos 0996fb5
Fixing lingering process mailbox test error
akoutmos ccb0896
Merge branch 'master' into task_supervisor_consumer
akoutmos 4eb7ef1
Fixing documentation
akoutmos 9ce9184
Added ability to configure termination timeout
akoutmos 7d016ca
Minor documentation tweaks
akoutmos 6a28687
Make error tests clearer
akoutmos 59b3e91
Fixed README docs
akoutmos 0b8298c
Added ability to timeout slow message handler tasks
akoutmos 073078c
Added handle_error callback along with tests
akoutmos bc2397a
Fixed flaky tests and added exception handling for non-concurrent mes…
akoutmos e14bfde
Added test for handle_error during syncronoush handle_message
akoutmos 72d45ee
Enhanced docs and tweaked synchronous handle_message error case
akoutmos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule GenRMQ.MessageTask do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea to wrap it like this 👍 |
||
@moduledoc """ | ||
Struct wrapping details of a Task that is executing the configured | ||
`handle_message` callback | ||
|
||
Defines: | ||
* `:task` - the Task struct executing the user's `handle_message` callback | ||
* `:timeout_reference` - the reference to the timeout timer | ||
* `:message` - the GenRMQ.Message struct that is being processed | ||
* `:exit_status` - the exist status of the Task | ||
""" | ||
|
||
@enforce_keys [:task, :timeout_reference, :message, :exit_status] | ||
defstruct [:task, :timeout_reference, :message, :exit_status] | ||
|
||
@doc false | ||
def create(task, timeout_reference, message) do | ||
%__MODULE__{ | ||
task: task, | ||
timeout_reference: timeout_reference, | ||
message: message, | ||
exit_status: nil | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double
message