Skip to content

Instantly share code, notes, and snippets.

@72squared
Created May 25, 2016 12:21
Show Gist options
  • Save 72squared/c20976e7797da516acaff7d936a029c3 to your computer and use it in GitHub Desktop.
Save 72squared/c20976e7797da516acaff7d936a029c3 to your computer and use it in GitHub Desktop.
some pseudo-code for what an async api for aerospike in python might look like.
config = {'hosts': [('127.0.0.1', 3000)]}
client = aerospike.client(config).connect()
foo_future = client.put_async(('test', 'demo', 'foo'), {'bin1': 1, 'bin2': 2})
bar_future = client.put_async(('test', 'demo', 'bar'), {'bin1': 1, 'bin2': 2})
bazz_future = client.get_async(('test', 'demo', 'bazz'))
foo_future.result()
bar_future.result()
bazz_future.result()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment