This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package timers | |
import ( | |
"sync" | |
"time" | |
) | |
var timerPool sync.Pool | |
// AcquireTimer from pool. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pools | |
import ( | |
"sync" | |
"time" | |
) | |
var timerPool sync.Pool | |
// AcquireTimer returns time from pool if possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/garyburd/redigo/redis" | |
) | |
func main() { | |
subConn, err := redis.Dial("tcp", "127.0.0.1:6379") | |
if err != nil { | |
panic(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gpool | |
import "context" | |
// Job represents function to be executed in worker. | |
type Job func() | |
type worker struct { | |
jobs chan Job | |
stop chan struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import requests | |
from PIL import Image | |
import requests.exceptions | |
from StringIO import StringIO | |
from django.core.files.base import ContentFile | |
from django.core.files.storage import FileSystemStorage | |
logger = logging.getLogger('uploads') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script type="text/javascript" src="https://rawgit.com/centrifugal/centrifuge-js/master/dist/centrifuge.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
const centrifuge = new Centrifuge('ws://localhost:8000/websocket'); | |
function drawText(text) { | |
const div = document.createElement('div'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "api.proto", | |
"version": "version not set" | |
}, | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
window.addEventListener('load', function() { | |
var canvas = document.getElementById('canvas'); | |
if (!canvas || !canvas.getContext) { | |
return false; | |
} | |
function rand(min, max) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gorelease -base=v0.7.0 -version=v0.8.0 | |
github.com/centrifugal/centrifuge | |
--------------------------------- | |
Incompatible changes: | |
- (*Client).Send: changed from func(github.com/centrifugal/protocol.Raw) error to func([]byte) error | |
- (*MemoryEngine).AddHistory: changed from func(string, *github.com/centrifugal/protocol.Publication, *ChannelOptions) (*github.com/centrifugal/protocol.Publication, error) to func(string, *github.com/centrifugal/protocol.Publication, *ChannelOptions) (StreamPosition, bool, error) | |
- (*Node).Disconnect: changed from func(string, bool) error to func(string, ...DisconnectOption) error | |
- (*Node).History: changed from func(string) ([]*github.com/centrifugal/protocol.Publication, error) to func(string, ...HistoryOption) (HistoryResult, error) | |
- (*Node).Publish: changed from func(string, []byte, ...PublishOption) error to func(string, []byte, ...PublishOption) (PublishResult, error) | |
- (*Node).Unsubscribe: changed from func(string, string) error to func(string, string, ...UnsubscribeOption |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { subscribe }; | |
var items = [ | |
{ | |
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI5YmRhNWNlYy02MzRiLTQ2NWItOTNmMC00MTc5MWNmNTAyYzgifQ.DSJ1n4Zrf7CGSX15em3FWrL_4hbJXUFr_lebSQvU7go', | |
channel: 'notifications#9bda5cec-634b-465b-93f0-41791cf502c8' | |
}, | |
{ | |
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiYWU3MTQxNy05MmVhLTRjMjMtODNkZi1mMDJlNTA2NTY0NmQifQ.lmfVqgTrGxX3Wy8nPC30852AbWnVUD9iJrWR209Qvw0', | |
channel: 'notifications#bae71417-92ea-4c23-83df-f02e5065646d' |