Description Usage Arguments Details Value Side effect Note See Also Examples
Wait if necessary before next API call to market (or any other source system) to do not get banned.
1 2 3 | antiddos_fun(source_system, antiddos.sec = getOption("Rbitcoin.antiddos.sec",
10), antiddos.verbose = getOption("Rbitcoin.antiddos.verbose", 0),
verbose = getOption("Rbitcoin.verbose", 0))
|
source_system |
character, a unique name of source system, could be any name |
antiddos.sec |
numeric time in seconds between API calls on the particular source system, defeault |
antiddos.verbose |
integer, Rbitcoin antiddos verbose message. Should be used when user prefer |
verbose |
integer. Rbitcoin processing messages, print to console if |
The following options can control antiddos process:
getOption("Rbitcoin.antiddos",TRUE)
getOption("Rbitcoin.antiddos.sec",10)
seconds to wait between calls to the same system
getOption("Rbitcoin.antiddos.fun",antiddos_fun)
- custom antiddos function. Default the one documentated on this site.
numeric time of wait in seconds.
Environment of name Rbitcoin.last_api_call
which holds the timestamps of last api call per source_system
during the R session.
Rbitcoin built-in antiddos function handle only api calls launched within the current R session.
By default it will wait getOption("Rbitcoin.antiddos.sec",10)
seconds between calls to the same system.
It cache the api calls in Rbitcoin.last_api_call
environment object in current workspace.
User can provide own custom antiddos function using getOption("Rbitcoin.antiddos.fun",antiddos_fun)
.
This way it is possible to cache last api call in own data storage (like database), this can allow concurrent R sessions + queueing to be handled by the antiddos process.
Custom antiddos should return numeric value of time spent on antiddos waiting in seconds.
market.api.process
, wallet_manager
1 2 3 4 5 6 7 8 | ## Not run:
# run below code in a batch
options("Rbitcoin.antiddos.verbose"=1) # alternatively: options("Rbitcoin.verbose" = 3)
market.api.process('kraken',c('BTC','EUR'),'ticker')
market.api.process('kraken',c('BTC','LTC'),'ticker')
options("Rbitcoin.antiddos.verbose"=0)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.