atom icon indicating copy to clipboard operation
atom copied to clipboard

please add more doc, please

Open daydaygo opened this issue 8 years ago • 3 comments

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
}

daydaygo avatar Jan 02 '17 07:01 daydaygo

datacenter_id和worker_id肯定是不会变的,只有时间戳和序列号会变

liexusong avatar Jan 03 '17 03:01 liexusong

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?

daydaygo avatar Jan 03 '17 04:01 daydaygo

如何设置datacenter和worker_id , 如果按照文档安装在多台机器上,默认 datacenter和worker_id都是0对吗? @liexusong

ideamean avatar Feb 13 '18 03:02 ideamean