Hellojungle commented on a change in pull request #4: Send orderly
URL: https://github.com/apache/rocketmq-client-go/pull/4#discussion_r239338199
 
 

 ##########
 File path: core/queue_selector.go
 ##########
 @@ -0,0 +1,62 @@
+package rocketmq
+
+import "C"
+import (
+       "strconv"
+       "sync"
+       "unsafe"
+)
+
+var selectors = selectorHolder{selectors: 
map[int]*messageQueueSelectorWrapper{}}
+
+//export queueSelectorCallback
+func queueSelectorCallback(size int, selectorKey unsafe.Pointer) int {
+       s, ok := selectors.getAndDelete(*(*int)(selectorKey))
+       if !ok {
+               panic("BUG: not register the selector with key:" + 
strconv.Itoa(*(*int)(selectorKey)))
 
 Review comment:
   Is this so serious to get a panic without recover?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to