Invoke executes all registered callback functions in the linked list Executes each callback in the order they were added Note: If a callback function is nil, it will be skipped If a callback panics, it will be handled by the outer caller's panic recovery
()
| 89 | // Note: If a callback function is nil, it will be skipped |
| 90 | // If a callback panics, it will be handled by the outer caller's panic recovery |
| 91 | func (t *callbacks) Invoke() { |
| 92 | // Traverse the entire linked list starting from the head node |
| 93 | for callback := t.first; callback != nil; callback = callback.next { |
| 94 | callback.call() |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | // Len returns the number of callback functions in the linked list |
| 99 | // Return value: Total number of currently registered callback functions |
no outgoing calls