Skip to content

New Feature: added args support for ngx.on_abort#269

Open
guanlan wants to merge 1 commit intoopenresty:masterfrom
guanlan:on_abort_args
Open

New Feature: added args support for ngx.on_abort#269
guanlan wants to merge 1 commit intoopenresty:masterfrom
guanlan:on_abort_args

Conversation

@guanlan
Copy link
Copy Markdown

@guanlan guanlan commented Aug 13, 2013

No description provided.

@bakins
Copy link
Copy Markdown
Member

bakins commented Aug 13, 2013

In typical Lua usage, one would just pass a closure to on_abort rather than using pass values:

 ngx.on_abort(function() someotherfunction(my, arguments, for, the, other, function) end )

@guanlan
Copy link
Copy Markdown
Author

guanlan commented Aug 13, 2013

Because we need keep consistent with ngx.timer.at API.

@agentzh
Copy link
Copy Markdown
Member

agentzh commented Aug 13, 2013

@bakins Creating new closures at every request does introduce some overhead (observable in on-CPU time Flame Graphs, for example), so I think we need the ability to pass user arguments just as in ngx.timer.at().

@bakins
Copy link
Copy Markdown
Member

bakins commented Aug 16, 2013

@agentzh I'm not surprised by the creation of a closure on each request showing up in a flame graph, I just wonder how much difference it makes in the real world. I don't have any strong feelings either way other than using a closure is more "Lua like."

@agentzh
Copy link
Copy Markdown
Member

agentzh commented Aug 19, 2013

@bakins Creating closures per request could be a real bottleneck, as observed as 20% ~ 30% overall overhead in an on-CPU time flame graph for our Lua WAF system. Even though in that case it was not ngx.on_abort() in particular, but more aggressive use of "higher-order functions".

@mergify
Copy link
Copy Markdown

mergify Bot commented Jun 26, 2020

This pull request is now in conflict :(

@mergify
Copy link
Copy Markdown

mergify Bot commented Mar 20, 2023

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Mar 20, 2023
@mergify mergify Bot removed the conflict label May 10, 2023
@mergify
Copy link
Copy Markdown

mergify Bot commented May 10, 2023

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label May 10, 2023
@mergify mergify Bot removed the conflict label Sep 23, 2023
@mergify
Copy link
Copy Markdown

mergify Bot commented Sep 23, 2023

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Sep 23, 2023
@mergify mergify Bot removed the conflict label Mar 6, 2024
@mergify
Copy link
Copy Markdown

mergify Bot commented Mar 6, 2024

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Mar 6, 2024
@mergify mergify Bot removed the conflict label May 27, 2024
@mergify
Copy link
Copy Markdown

mergify Bot commented May 27, 2024

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label May 27, 2024
@mergify mergify Bot removed the conflict label Feb 13, 2025
@mergify
Copy link
Copy Markdown

mergify Bot commented Feb 13, 2025

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Feb 13, 2025
@mergify mergify Bot removed the conflict label May 7, 2025
@mergify
Copy link
Copy Markdown

mergify Bot commented May 7, 2025

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label May 7, 2025
@mergify mergify Bot removed the conflict label Jul 9, 2025
@mergify
Copy link
Copy Markdown

mergify Bot commented Jul 9, 2025

This pull request is now in conflict :(

@mergify mergify Bot added the conflict label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants