You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/12/06 06:24:06 UTC

[GitHub] Hellojungle commented on a change in pull request #4: Send orderly

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:
users@infra.apache.org


With regards,
Apache Git Services