Golang HTTP 的 longpolling 库 Golongpoll

码农软件 · 软件分类 · 高性能网络开发库 · 2019-08-31 22:57:38

软件介绍

Golongpoll 是 golang HTTP 的 longpolling 库,可以使构建 web pub-sub 更加容易。

基本用法:

import  "github.com/jcuga/golongpoll"
// This launches a goroutine and creates channels for all the plumbing
manager, err := golongpoll.CreateManager()
// Expose events to browsers
// See subsection on how to interact with the subscription handler
http.HandleFunc("/events", manager.SubscriptionHandler)
http.ListenAndServe("127.0.0.1:8081", nil)
// Pass the manager around or create closures and publish:
manager.Publish("subscription-category", "Some data.  Can be string or any obj convertable to JSON")
manager.Publish("different-category", "More data")

本文地址:https://codercto.com/soft/d/13608.html

图论算法理论、实现及应用

图论算法理论、实现及应用

王桂平//王衍//任嘉辰 / 北京大学 / 2011-1 / 54.00元

《图论算法理论、实现及应用》系统地介绍了图论算法理论,并选取经典的ACM/ICPC竞赛题目为例题阐述图论算法思想,侧重于图论算法的程序实现及应用。《图论算法理论、实现及应用》第1章介绍图的基本概念和图的两种存储表示方法:邻接矩阵和邻接表,第2~9章分别讨论图的遍历与活动网络问题,树与图的生成树,最短路径问题,可行遍性问题,网络流问题,支配集、覆盖集、独立集与匹配,图的连通性问题,平面图及图的着色问......一起来看看 《图论算法理论、实现及应用》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换