atom
atom copied to clipboard
please add more doc, please
advise to add your blog link
i came this project from your blog, advise to add the blog url to readme file
some question
atom_explain($id) return timestamp / datacenter / worker, but i use the code below to test, datacenter and worker are the same, do you make change to the snowflake algorithm ?
for ($i=0; $i < 20; $i++) {
$id = atom_next_id(); // is different
$info = atom_explain($id);
echo $id . "\t" . date('YmdHis', $info['timestamp']) . "\t" . $info['datacenter'] . "\t" . $info['worker'] . "\n"; // $info are the same
}
datacenter_id和worker_id肯定是不会变的,只有时间戳和序列号会变
thx, i have read your code of atom.c and figure it out.
but is the datacenter_id for a machine and worker_id for a php-fpm process?
如何设置datacenter和worker_id , 如果按照文档安装在多台机器上,默认 datacenter和worker_id都是0对吗? @liexusong