diff options
author | Valery Piashchynski <[email protected]> | 2021-05-29 11:27:49 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-05-29 11:27:49 +0300 |
commit | 09b982813f8825f776abf20fb16c6085439ca4ba (patch) | |
tree | 1c4593bdc42503616b06f32bb6ee676cca38515a /plugins/http/channel.go | |
parent | fcda08498e8f914bbd0798da898818cd5d0e4348 (diff) |
- Update channel plugin interfaces
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/http/channel.go')
-rw-r--r-- | plugins/http/channel.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/http/channel.go b/plugins/http/channel.go index 42b73730..23b5ff3e 100644 --- a/plugins/http/channel.go +++ b/plugins/http/channel.go @@ -6,7 +6,7 @@ import ( // messages method used to read messages from the ws plugin with the auth requests for the topics and server func (p *Plugin) messages() { - for msg := range p.hub.ReceiveCh() { + for msg := range p.hub.ToWorker() { p.RLock() // msg here is the structure with http.ResponseWriter and http.Request rmsg := msg.(struct { @@ -14,9 +14,10 @@ func (p *Plugin) messages() { Req *http.Request }) + // invoke handler with redirected responsewriter and request p.handler.ServeHTTP(rmsg.RW, rmsg.Req) - p.hub.SendCh() <- struct { + p.hub.FromWorker() <- struct { RW http.ResponseWriter Req *http.Request }{ |