comtihon / mongodb-erlang

MongoDB driver for Erlang
Apache License 2.0
341 stars 267 forks source link

variable name #161

Open turtleDeng opened 7 years ago

turtleDeng commented 7 years ago

[ { name, Name }, % Name should be used for mongoc pool to be registered with { register, Name }, % Name should be used for mongoc topology process to be registered with

{ pool_size, 5 }, % pool size on start
{ max_overflow, 10 },   % number of overflow workers be created, when all workers from pool are busy
{ overflow_ttl, 1000 }, % number of milliseconds for overflow workers to stay in pool before terminating
{ overflow_check_period, 1000 }, % overflow_ttl check period for workers (in milliseconds)

{ localThresholdMS, 1000 }, % secondaries only which RTTs fit in window from lower RTT to lower RTT + localThresholdMS could be selected for handling user's requests

{ connectTimeoutMS, 20000 },
{ socketTimeoutMS, 100 },

{ serverSelectionTimeoutMS, 30000 }, % max time appropriate server should be select by
{ waitQueueTimeoutMS, 1000 }, % max time for waiting worker to be available in the pool

{ heartbeatFrequencyMS, 10000 },    %  delay between Topology rescans
{ minHeartbeatFrequencyMS, 1000 },

{ rp_mode, primary }, % default ReadPreference mode - primary, secondary, primaryPreferred, secondaryPreferred, nearest

{ rp_tags, [{tag,1}] }, % tags that servers shoul be tagged by for becoming candidates for server selection  (may be an empty list)

]

variable name

  1. xxx_xxx_xxx
  2. SayHelloWord

Whether it can unify variable name rules

comtihon commented 7 years ago

You mean refactor all keys to snake_style?

turtleDeng commented 7 years ago

Yes, there is a problem with { rs, <<"ReplicaSetName">>, [ "hostname1:port1", "hostname2:port2"] }

https://github.com/comtihon/mongodb-erlang/blob/master/src/api/mongo_api.erl#L28