#637 closed enhancement (fixed)
Callable hooks that iterate through vs hooks that halt
| Reported by: | Christopher Allan Webber | Owned by: | Christopher Allan Webber |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4.0 |
| Component: | programming | Keywords: | pluginapi |
| Cc: | Parent Tickets: |
Description
We can handle notification and transform via the "callable hooks" system, but we don't have a "handler" that is the last one to get it and then things stop.
One way to handle this: have a series of method calling handlers that do things in different ways, like:
- callable_hook_runone: runs them all till they stop
- which order? Does the last or the first get to claim it?
- callable_hook_runall: runs every one of the hooks
- likewise... which order?
.. both of those would expect *args, **kwargs and pass those keyword
arguments onto the hooks.
It might also be possible to make some callable classes like this, like:
callable_hook = CallableHookRunone(
'some_hookname', accrue=True) # accrues the results into a list
results = callable_hook(arg1, arg2, kwarg="foo")
Change History (5)
comment:1 by , 13 years ago
| Keywords: | pluginapi added; plugin removed |
|---|
comment:2 by , 13 years ago
| Summary: | Convenient callable hooks that iterate through vs hooks that halt → Callable hooks that iterate through vs hooks that halt |
|---|
comment:3 by , 13 years ago
| Type: | defect → enhancement |
|---|
comment:4 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:5 by , 13 years ago
I'm reopening this, given the new plans I wrote to the list:
- http://lists.mediagoblin.org/pipermail/devel/2013-April/000497.html
- http://lists.mediagoblin.org/pipermail/devel/2013-April/000498.html
So I'm going to do that then close this out :)

Just hit master! With tests!