diff options
| author | alex <[email protected]> | 2026-07-12 14:09:36 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-12 14:09:36 +0200 |
| commit | ce9d9f8b2183bc0a31bfa40e780ae07182bc7cf8 (patch) | |
| tree | 73eefd7228bb3ba820c618777495b60a3fb6860f /main.go | |
| parent | 89b3019a3ab77a3e72720342fc0e5bea996fa4f2 (diff) | |
| download | redis-clone-command-registry.tar.xz redis-clone-command-registry.zip | |
added pubsub command registrycommand-registry
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -86,7 +86,13 @@ func handleConnection(conn net.Conn) { command := strings.ToUpper(args[0]) - conn.Write(core.SerializeRESP(commands.DispatchBaseCommand(db,command,args))) - + if cmd , ok := commands.PubSubRegistry[command]; ok { + commands.DispatchPubSub(conn, &hub, cmd, args) + } else if cmd, ok := commands.BaseRegistry[command]; ok { + res := commands.DispatchBaseCommand(db, cmd, args) + conn.Write(core.SerializeRESP(res)) + } else { + conn.Write(core.SerializeRESP(fmt.Errorf("ERR unknown command '%s'", command))) + } } }
\ No newline at end of file |
