Skip to content

v1.9.0 Random subclass, fetch timeout#22

Open
calebj wants to merge 1 commit intolmacken:developfrom
calebj:random-lib-timeout
Open

v1.9.0 Random subclass, fetch timeout#22
calebj wants to merge 1 commit intolmacken:developfrom
calebj:random-lib-timeout

Conversation

@calebj
Copy link

@calebj calebj commented Nov 10, 2018

Adds a subclass of random.Random that pulls from the ANU QRN server. It defaults to caching 1kb of raw binary data, and automatically fetches more on demand, or in the background when less than 64 bytes of random data remain. These parameters can be adjusted in the QuantumRandom constructor: caching can be disabled by specifying cached_bytes = None, and auto-fetching disabled with autofetch_at = None.

get_data() also has a new parameter timeout, which is passed directly to urlopen(), and the other data-retrieving functions will pass their kwargs through so that timeout can be specified in any of them.

Missing until the base idea is greenlit:

  • docs
  • tests

@calebj calebj force-pushed the random-lib-timeout branch from 5d04f0a to 8ded81b Compare November 10, 2018 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant