Created
December 18, 2017 16:04
-
-
Save jaehue/ad6a9ad357f72226bf047b0217932096 to your computer and use it in GitHub Desktop.
이벤트브로커에서 이벤트 처리
This file contains hidden or 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
| func (j *Job) Run(in <-chan *sarama.ConsumerMessage) <-chan *sarama.ConsumerMessage { | |
| out := make(chan *sarama.ConsumerMessage) | |
| for msg := range in { | |
| wg := sync.WaitGroup{} | |
| for _, eh := range j.eventHandlers { | |
| wg.Add(1) | |
| go func(eh *eventbroker.EventHandler) { | |
| defer wg.Done() | |
| /************ | |
| * 이벤트 처리 * | |
| ************/ | |
| }(eh) | |
| } | |
| wg.Wait() | |
| out <- msg | |
| } | |
| return out | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment