zjykzk commented on a change in pull request #2: Make code be consistent with Golang Specfication URL: https://github.com/apache/rocketmq-client-go/pull/2#discussion_r234935832
########## File path: core/cfuns.go ########## @@ -14,15 +14,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package client +package rocketmq -//#cgo CFLAGS: -I/usr/local/include/rocketmq -//#cgo LDFLAGS: -L/usr/local/lib -lrocketmq -//#include "CMessageExt.h" -//#include "CPushConsumer.h" +/* +#cgo LDFLAGS: -L/usr/local/lib -lrocketmq +#include "rocketmq/CMessageExt.h" +#include "rocketmq/CPushConsumer.h" +*/ import "C" +import ( + "sync" +) + +var pushConsumerMap = make(map[*C.CPushConsumer]*defaultPushConsumer) Review comment: "The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex." the document from the golang sdk;) ---------------------------------------------------------------- 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
