Method
Dispatcher
(payload types.MessagePayload, title, body string, _ template.FuncMap)
Source from the content-addressed store, hash-verified
| 126 | } |
| 127 | |
| 128 | func (c chanHandler) Dispatcher(payload types.MessagePayload, title, body string, _ template.FuncMap) (dispatch.DeliveryFunc, error) { |
| 129 | result := make(chan dispatchResult) |
| 130 | call := dispatchCall{ |
| 131 | payload: payload, |
| 132 | title: title, |
| 133 | body: body, |
| 134 | result: result, |
| 135 | } |
| 136 | return func(ctx context.Context, _ uuid.UUID) (bool, error) { |
| 137 | select { |
| 138 | case c.calls <- call: |
| 139 | select { |
| 140 | case r := <-result: |
| 141 | return r.retryable, r.err |
| 142 | case <-ctx.Done(): |
| 143 | return false, ctx.Err() |
| 144 | } |
| 145 | case <-ctx.Done(): |
| 146 | return false, ctx.Err() |
| 147 | } |
| 148 | }, nil |
| 149 | } |
| 150 | |
| 151 | var _ notifications.Handler = &chanHandler{} |
Callers
nothing calls this directly
Tested by
no test coverage detected