채널이름을 모든 public 함수의 signature를 고려

This commit is contained in:
2023-07-10 12:13:51 +09:00
parent c859aeb75f
commit b5a72aad05
2 changed files with 21 additions and 7 deletions

View File

@ -58,9 +58,18 @@ func Start(ctx context.Context, redisClient *redis.Client) {
}
hash := md5.New()
for k := range engine.receivers {
for k, manifest := range engine.receivers {
hash.Write([]byte(k))
for m, r := range manifest.methods {
hash.Write([]byte(m))
hash.Write([]byte(r.Name))
for i := 0; i < r.Type.NumIn(); i++ {
inName := r.Type.In(i).Name()
hash.Write([]byte(inName))
}
}
}
pubsubName := hex.EncodeToString(hash.Sum(nil))[:16]
engine.publish = func(s []byte) error {