spynup
ecd836af75
Listen to CloseNotifier in stream handler.
...
Problem:
context.Stream() already listens to the closeNotifier, which gives the impression that context.Stream() will return as soon as a client disconnects. Unfortunately, it doesn't!
This example code furthers the impression with the defer closeListener(roomid, listener) which one would expect to be called when a client navigates away, which is not the case. In fact, it's only called on the next message that's sent to the room after said client exits.
This is because c.SSEvent("message", <-listener) blocks indefinitely until a message comes in, so will not return and yield to c.Stream()'s select that catches the closeNotify. This means that if a client navigates away, the server never notices and cleans up.
Fix: Also listen to CloseNotifier inside stream handler. This causes the step() function to return immediately when the client goes away and allows the cleanup to run. Updating this example should make it more clear, I think!
2015-07-22 12:20:47 -07:00
Brendan Fosberry
302cd99322
Fixing compile bug
2015-05-29 12:12:54 -05:00
Manu Mtz-Almeida
4797530476
Fixes example code
2015-05-26 12:15:43 +02:00
Manu Mtz-Almeida
66fa43f9ae
Preparing release Gin v1.0rc1
2015-05-22 16:55:16 +02:00
Manu Mtz-Almeida
05d01d2282
Restored old limits
2015-05-14 22:52:37 +02:00
Manu Mtz-Almeida
e33ea855d7
Message for attackers
2015-05-14 22:49:42 +02:00
Manu Mtz-Almeida
3db1479acc
More changes!
2015-05-14 20:52:45 +02:00
Manu Mtz-Almeida
c3ecb91dbf
Trying fmt
2015-05-14 20:50:06 +02:00
Manu Mtz-Almeida
b0aa2e407c
Testing....
2015-05-14 20:46:57 +02:00
Manu Mtz-Almeida
ef93e8beff
More aggressive rate limit
2015-05-14 20:43:33 +02:00
Manu Mtz-Almeida
3f48e0d45c
Adds rate limiting
2015-05-14 20:25:55 +02:00
Manu Mtz-Almeida
eed6d93095
Better stats in realtime-advanced
2015-05-14 18:16:00 +02:00
Manu Mtz-Almeida
286d775de6
Updates realtime-advanced
2015-05-14 17:01:02 +02:00
Manu Mtz-Almeida
58ceb244e5
Serving on port 80
2015-05-14 04:43:39 +02:00
Manu Mtz-Almeida
e7adcaf591
Cosmetic changes in realtime-advanced
2015-05-14 04:39:17 +02:00
Manu Mtz-Almeida
a8b9e2d8d6
Updates realtime-advanced demo
2015-05-13 20:54:54 +02:00
Manu Mtz-Almeida
7149009a84
Fixed some bug in realtime-advanced demo
2015-05-13 17:34:42 +02:00
Manu Mtz-Almeida
1f11541011
Updates realtime-advanced demo
2015-05-13 16:44:44 +02:00
Manu Mtz-Almeida
9386d78673
Better rate limiting
2015-05-13 03:45:17 +02:00
Manu Mtz-Almeida
7e6153dc33
Middleware order changed
2015-05-13 03:36:32 +02:00
Manu Mtz-Almeida
d05b31ed77
Reduced limit
2015-05-13 03:21:10 +02:00
Manu Mtz-Almeida
313d05ed68
Add rate limitting
2015-05-13 03:19:44 +02:00
Manu Mtz-Almeida
53d29b14f6
Using bar graph
2015-05-13 02:53:09 +02:00
Manu Mtz-Almeida
3fb8a25a21
Adds realtime-advanced demo
2015-05-13 02:35:16 +02:00
Manu Mtz-Almeida
15b0c49da5
Adds realtime-chat example code
2015-05-12 19:23:54 +02:00
Manu Mtz-Almeida
0a192fb0fa
Tons of unit tests
2015-04-09 12:15:02 +02:00
Manu Mtz-Almeida
ac0ad2fed8
Improves unit tests
2015-04-08 02:58:35 +02:00
Javier Provecho Fernandez
852729e90c
Fix PR #71
2015-01-04 01:51:41 +01:00
mopemoepe
2c3cdbb69f
Add Pluggable View Renderer Example
...
Gin meets pongo2!
(https://github.com/flosch/pongo2 )
2014-07-17 00:37:56 +09:00
Manu Mtz-Almeida
07fe0d9944
Merge branch 'bindings' into develop
2014-07-05 02:49:25 +02:00
Manu Mtz-Almeida
8f3f3597f3
Merge branch 'master' of https://github.com/ngerakines/gin into ngerakines-master
...
It adds MustGet() method in context.
Conflicts:
examples/example_basic.go
2014-07-04 17:05:56 +02:00
Manu Mtz-Almeida
9efd207a04
Fixes BasicAuth test in example_basic.go
2014-07-04 04:40:00 +02:00
Nick Gerakines
108bfb4470
Setting Get metadata method to return both an interface as well as an error to remove panic.
2014-07-03 15:17:24 -04:00
Manu Mtz-Almeida
1aa3216303
Some work around bindings. it may do not compile
2014-07-03 19:19:06 +02:00
Javier Provecho Fernandez
05d587d65e
Clarification
2014-07-02 22:48:06 +02:00
Javier Provecho Fernandez
ca91a4a6da
Fix
...
Modified ping path and added a comment explaining why init() is called
like that.
2014-07-02 22:39:42 +02:00
Javier Provecho Fernandez
f380265f5d
Added README.md
2014-07-02 22:38:02 +02:00
Javier Provecho Fernandez
6b5e80901f
Added Google App Engine Example
2014-07-02 22:08:37 +02:00
Rajiv Kilaparti
14077b1020
Fix Port usage
...
* Update Server's Listening Port from 8081 ==> 8080
2014-07-01 11:37:13 +05:30
Manu Mtz-Almeida
15216a0883
Initial commit
2014-06-18 01:42:34 +02:00