-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More thread safety: Create new Executor instance for each stack start.
It in turn creates new instances of Middleware chain.
- Loading branch information
Showing
1 changed file
with
43 additions
and
32 deletions.
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
35dc1b9
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.
@ronen sorry, I commented on the wrong fork... could you have a look at the comments in lowjoel/modware@35dc1b95bc348accc7987f1c58a96221b87181ee
35dc1b9
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.
Oops, I think I know what you mean. The result must be explicitly captured by the middleware. That's a little counterintuitive, but I've fixed that (I think) in SchemaPlus/schema_plus_core#2
35dc1b9
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.
@lowjoel Yes, that's a design choice / requirement. If the result is to be returned to the caller, the middleware "env" object must capture it, to give
after
andaround
methods the chance to modify it; and the wrapper extracts and return it.35dc1b9
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.
35dc1b9
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.
It's in the README for modware -- any way or place I can put it that would make it easier to find?
35dc1b9
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.
hmm, that would be the natural place to put it, it didn't occur to me.
I think it's because schema_plus_core and schema_monkey used modware implicitly so the natural instinct was to do as @ronen did =P the examples I referenced didn't use its return result, so it didn't occur to me that it was the pattern to follow
(and I checked schema_monkey, the readme did mention it... ohwell... I should have RTFM'ed...)