Data::STUID - Yet Another Unique ID Generator
# see Data::STUID::Server # Data::STUID::Client # Data::STUID::Generator
Minimalistic unique ID generator. Main logic ported from STF (http://github.com/stf-storage/stf).
The generated IDs are always in 64bit range, and can be ordered sequentially, so it's easy to use for sort operations.
For programmatic usage, see Data::STUID::Server
You can do the regular
perl Build.PL ./Build ./Build install
and then execute stuid-server directly, but you could also use carton.
stuid-server
carton
install carton >= 0.9.10, and cpanm >= 1.60002.
cd /path/to/Data-STUID carton install # optionally, skip tests: 'PERL_CPANM_OPT=-n carton install'
Plain usage would be:
stuid-server --host_id=1
With carton:
carton exec -I/path/to/Data-STUID/lib -- \ /path/to/Data-STUID/script/stuid-server \ --host_id=1
It might be easier if you wrap the above in a shell script, say server.sh:
#!/bin/sh STUID_HOME=/path/to/Data-STUID exec \ carton exec -I$STUID_HOME/lib -- \ $STUID_HOME/script/stuid-server $@
Then execute it as:
./server.sh --host_id=1
Note that you need pass a unique host_id parameter to each distinct STUID server instance
host_id
Data::STUID::Server is a subclass of Net::Server::PreFork. You should be able to pass parameters that the parent class accepts. If the script doesn't, send me a pullreq!
Data::STUID::Server
For programmatic usage, see Data::STUID::Client
See "SAMPLE SERVER SETUP"
stuid-client --server=127.0.0.1:9001 --server=127.0.0.1:9002 ... carton exec -I/path/to/Data-STUID/lib -- \ /path/to/Data-STUID/script/stuid-client \ --server=127.0.0.1:9001 --server=127.0.0.1:9002 ...
Daisuke Maki <daisuke@endeworks.jp>
<daisuke@endeworks.jp>
To install Data::STUID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::STUID
CPAN shell
perl -MCPAN -e shell install Data::STUID
For more information on module installation, please visit the detailed CPAN module installation guide.