xiangace's recent timeline updates
xiangace's repos on GitHub
Python · 6 watchers
kkconst
Define const field and const class, customize it as You Like (Python)
Go · 1 watchers
golangci-lint
Linters Runner for Go. 5x faster than gometalinter. Nice colored output. Can report only new issues. Fewer false-positives. Yaml/toml config.
Python · 1 watchers
read-flv
read flv file, list file info
1 watchers
tech
programming, database, distributed system
C++ · 0 watchers
doom3.gpl
Doom 3 GPL source release
Go · 0 watchers
gin
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
Go · 0 watchers
go-nsq
The official Go package for NSQ
0 watchers
gocognit
Calculates cognitive complexities of functions in Go source code. (Golang cognitive complexity)
HTML · 0 watchers
kaka19ace.github.io
blog
0 watchers
keep-a-changelog
If you build software, keep a changelog.
C++ · 0 watchers
kkbasic
simple cpp basic lib, just code toy, data struct, logger, buffer
Python · 0 watchers
kklogger
logger util for python
Python · 0 watchers
kkutil
Python util tool
0 watchers
machine-learning-for-software-engineers
A complete daily plan for studying to become a machine learning engineer.
Shell · 0 watchers
oh-my-quick-cmd
Just only for me, my quick cmd :)
Python · 0 watchers
pulsar
Event driven framework for python
Python · 0 watchers
pycmd-tools
basic cmd tools ( Implemented by Python)
0 watchers
Qix
Node.Js、Golang、Machine Learning、PostgreSQL、Deep Learning
Python · 0 watchers
tornado
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
Python · 0 watchers
tornado-rest
A simple and useful Restful API for Tornado Web Server
Python · 0 watchers
useless-utils
useless utils function class generator etc. (using Python)
VimL · 0 watchers
vim
vim配置文件和插件
CSS · 0 watchers
wdb
An improbable web debugger through WebSockets
xiangace

xiangace

V2EX member #53188, joined on 2014-01-02 18:06:08 +08:00
xiangace's recent replies
Jan 7, 2019
Replied to a topic by smelond Python Python 关于多线程和多进程同时共用问题
接上一跳评论,理解错题意了, win 下的机制比较诡异.
Jan 7, 2019
Replied to a topic by smelond Python Python 关于多线程和多进程同时共用问题
1. 多线程实际上还是利用单核, 直接用多进程.
2. Python 在共享全局变量这块做的不太好, 多线程场景可以查询下 thread local 相关的资料.
多进程考虑 multiprocessing 的 value 机制, multiprocessing 支持一个 daemon 进程维护这组变量, 多进程通过 IPC
Dec 13, 2015
Replied to a topic by henryho914 Python 请问一个关于定义常量的报错信息
@henryho914 那个库实现的代码写复杂了, 可以看我的一篇文章, 由简单的需求衍生出来的库的历史,
大致上是一个演进的过程, 提供 metaclass 的使用案例, 可能帮助你理解你现在的场景需求.
[ 应用于 Restful 接口的错误码设计 – ErrorCode Class(Python) ]( http://www.kaka-ace.com/restful_api_error_code_design_for_python/)
只说一句话改的太轻松了, 不负责任 或者 业务线访问量就很小, 价值不大的场景......

1. 如果属于底层基础库, 修改类似以下的规则. 如果仅仅是单个业务层的代码, 调用少可以替换再部署上线.
2. 根据你的编程语言, eg: py 类就加新的类名, 然后 B = A 引用赋值.
3. 根据你熟悉的业务场景依次修改并观察线上日志收集平台, 注意是否有涉及接口的 error 信息
4. 如果是快废弃的代码, 真的没必要再操心.
5. 保证业务运行正常是首要的.
Dec 3, 2015
Replied to a topic by henryho914 Python 请问一个关于定义常量的报错信息
Dec 3, 2015
Replied to a topic by henryho914 Python 请问一个关于定义常量的报错信息
安利下我的作品 kkconst
Dec 3, 2015
Replied to a topic by JiaFeiX 云计算 继续求一个靠谱的短信发送服务商
sendcloud
@siteshen 源码里有一个文件 ketama.py, 类似 mc 的 client 机制. 至于要严格在同一个 node ,可能你的场景要求高. 如果纯粹是当做 mc 原来的使用目的, 这个项目也足够了, 再把 redis 禁止 save, 纯缓存服务.
至于要用到 list 当队列操作 push pop, 这个场景不适合.

我猜想的是题主的运行环境是一个纯缓存的业务, 替换 mc.

pipeline 或者 lua 之类的操作, 使用豌豆荚 codis 比较合理, 这类需求出发的设计的话, redis client 的不应该自己实现调度, 而是得写一套中间服务的 proxy. redis-client 只需要做的是 从配置文件或者发现服务取 proxy 地址即可, 那么用原生的 redis-py 配置上现有的框架能满足大多数通用需求. 而且与后端数据服务是如何实现是隔离屏蔽的,不需要了解后端数据接口的具体实现.
@rogwan
抱歉, nginx 还需要加上:
proxy_pass_header Server;
headers.environ.get("HTTP_X_Forwarded_For", headers.get('HTTP_X_REAL_IP', request.remote_addr))
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2883 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 12:39 · PVG 20:39 · LAX 05:39 · JFK 08:39
♥ Do have faith in what you're doing.