mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 04:47:02 +00:00
Add Party.Container.SetDependencyMatcher, hero.Container.DependencyMatcher and hero.Dependency.Match to fullfil the feature request asked at: #1842
This commit is contained in:
@@ -4,11 +4,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
"github.com/r3labs/sse"
|
||||
"github.com/r3labs/sse/v2"
|
||||
)
|
||||
|
||||
// First of all install the sse third-party package (you can use other if you don't like this approach or go ahead to the "sse" example)
|
||||
// $ go get -u github.com/r3labs/sse
|
||||
// $ go get github.com/r3labs/sse/v2@v2.7.4
|
||||
func main() {
|
||||
app := iris.New()
|
||||
s := sse.New()
|
||||
@@ -22,7 +22,7 @@ func main() {
|
||||
*/
|
||||
s.CreateStream("messages")
|
||||
|
||||
app.Any("/events", iris.FromStd(s.HTTPHandler))
|
||||
app.Any("/events", iris.FromStd(s))
|
||||
|
||||
go func() {
|
||||
// You design when to send messages to the client,
|
||||
|
||||
Reference in New Issue
Block a user