pusher
My copy
Setup
npm install && bower install
Run tests
npm test
Build
gulp
Publish
- Bump the version in
package.json
. - Build
- Push to github.
- Create a new release
Simple pub/sub in Go
License: MIT License
Occasionally when connecting to Pusher, we get no welcome message, and thus no session ID to use for future posts etc. This causes us to stall.
terminate() is called by 3 diffrent defere states, and will run about the same time.
WARNING: DATA RACE
Read by goroutine 54:
github.com/zond/pusher/hub.(_Session).terminate()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:434 +0x2a0
github.com/zond/pusher/hub.(_Session).Handle()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:481 +0x628
github.com/zond/pusher/hub.(_Session).handleWS()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:440 +0xd1
github.com/zond/pusher/hub._Session.(github.com/zond/pusher/hub.handleWS)·fm()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:192 +0x3d
code.google.com/p/go.net/websocket.Server.serveWebSocket()
/Users/jimmywennlund/go/src/code.google.com/p/go.net/websocket/server.go:98 +0x279
code.google.com/p/go.net/websocket.Handler.ServeHTTP()
/Users/jimmywennlund/go/src/code.google.com/p/go.net/websocket/server.go:121 +0xad
github.com/zond/pusher/hub.(_Server).ServeHTTP()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:192 +0x35b
net/http.serverHandler.ServeHTTP()
/usr/local/go/src/pkg/net/http/server.go:1597 +0x1ca
net/http.(_conn).serve()
/usr/local/go/src/pkg/net/http/server.go:1167 +0xc00
Previous write by goroutine 61:
github.com/zond/pusher/hub.(_Session).terminate()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:435 +0x36c
github.com/zond/pusher/hub.(_Session).writeLoop()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:304 +0x3a7
Goroutine 54 (running) created at:
net/http.(_Server).Serve()
/usr/local/go/src/pkg/net/http/server.go:1644 +0x2c1
net/http.(_Server).ListenAndServe()
/usr/local/go/src/pkg/net/http/server.go:1612 +0xc0
net/http.ListenAndServe()
/usr/local/go/src/pkg/net/http/server.go:1677 +0xb7
main.main()
/Users/jimmywennlund/go/src/github.com/zond/pusher/pusher_server/pusher_server.go:18 +0x39b
Goroutine 61 (finished) created at:
github.com/zond/pusher/hub.(_Session).Handle()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:458 +0x368
github.com/zond/pusher/hub.(_Session).handleWS()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:440 +0xd1
github.com/zond/pusher/hub._Session.(github.com/zond/pusher/hub.handleWS)·fm()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:192 +0x3d
code.google.com/p/go.net/websocket.Server.serveWebSocket()
/Users/jimmywennlund/go/src/code.google.com/p/go.net/websocket/server.go:98 +0x279
code.google.com/p/go.net/websocket.Handler.ServeHTTP()
/Users/jimmywennlund/go/src/code.google.com/p/go.net/websocket/server.go:121 +0xad
github.com/zond/pusher/hub.(_Server).ServeHTTP()
/Users/jimmywennlund/go/src/github.com/zond/pusher/hub/hub.go:192 +0x35b
net/http.serverHandler.ServeHTTP()
/usr/local/go/src/pkg/net/http/server.go:1597 +0x1ca
net/http.(*conn).serve()
/usr/local/go/src/pkg/net/http/server.go:1167 +0xc00
Will the client not resubscribe automaticly...
/J
@jimmyw: we need to either support it, or protect against it.
...since JS doesn't have proper hashmaps pre-ES6, all maps use string based keys.
If the function is JITed, its toString signature will be something similar to function(){ [native code] }
which means we can't pick up a reference to it again.
In this case, it's safer to rely on subscriptions[uri] = [];
and use [].indexOf
to pick up the correct index.
Use window.clearInterval
instead of this.clearInterval
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.