MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Sync

Method Sync

IceFireDB-PubSub/pkg/router/redisNode/router.go:103–128  ·  view source on GitHub ↗
(args []interface{})

Source from the content-addressed store, hash-verified

101}
102
103func (r *Router) Sync(args []interface{}) error {
104 cmdType := strings.ToUpper(args[0].(string))
105 op, ok := router.OpTable[cmdType]
106 handlers, ok := r.cmd[cmdType]
107 if !ok {
108 handlers = r.cmd[CMDEXEC]
109 }
110 c := r.pool.Get().(*router.Context)
111 defer func() {
112 c.Reset()
113 r.pool.Put(c)
114 }()
115
116 c.Index = -1
117 c.Writer = RESPHandle.NewWriterHandle(io.Discard)
118 c.Args = args
119 c.Handlers = handlers
120 c.Cmd = cmdType
121 c.Op = op.Flag
122 c.Reply = nil
123 handle := handlers.Last()
124 if handle != nil {
125 return handle(c)
126 }
127 return nil
128}
129
130var _ router.IRoutes = (*Router)(nil)
131

Callers

nothing calls this directly

Calls 4

GetMethod · 0.45
ResetMethod · 0.45
PutMethod · 0.45
LastMethod · 0.45

Tested by

no test coverage detected