jcelliott / turnpike

Go implementation of a WAMP (Web Application Messaging Protocol) client and router
MIT License
258 stars 88 forks source link

Breaking Change - All functions that took a Peer now take a *Session #108

Open beatgammit opened 8 years ago

beatgammit commented 8 years ago

I basically rewrote dealer.go on a rereading of the spec. I was getting errors with AutobahnPython saying that the INVOCATION ID was reused (was causing somewhat random crashes). We were using NewID() to generate this, which generates the ID randomly, so I switched it to a session-specific, incrementing ID as per the spec. I also simplified some of the internal data structures.

Moving the *Session into the Dealer is a breaking change and was needed to generate session-specific identifiers for the fix. We talked about this previously, and we had decided not to do it because there wasn't a reason to complicate matters, but I think this is now necessary to be spec compliant.

If this looks good to you, I can check if our ids are correct elsewhere.

beatgammit commented 8 years ago

This is the fix for #85

mourad commented 8 years ago

IMO, it does makes sense to make this API change. I also found this change is needed in order to add smarter external router/broker (i.e. make routing decision based on session data)

The beatgammit:v2 branch has moved forward since this PR was created and now includes a lot of other changes. Could you change this PR to only include the original changes?