Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Async commands should return command sequence numbers #21

Open
rpcope1 opened this issue Sep 19, 2014 · 2 comments
Open

Comments

@rpcope1
Copy link
Contributor

rpcope1 commented Sep 19, 2014

Nacho,

One things that would be helpful would be if for each async command, we were returned the sequence number used to send the command. While I can't build my callback functions directly with the sequence number now (perhaps you could add a function to get the next possible sequence number), I could add each sequence number into a queue, and pop numbers off as messages are received. If I had a command fail to come back, it should be pretty straightforward for the user to build up the framework to figure this our relatively quickly.

Example:

 my_queue = Queue.Queue()
 client = kinetic.ThreadedClient('192.168.128.10')
 for I in xrange(100):
    #blah blah blah build up callback handlers with keys and values
    seq_num = client.putAsync(key, value, success_handler(my_queue, i), failure_handler(my_queue, i))
    my_queue.put((seq_num, i))
 #Watch for callbacks to come back, if something fails, track it back to individual sequence number.```
@icorderi
Copy link
Member

You already solved your need in your own example.

client.putAsync(key, value, success_handler(my_queue, i),failure_handler(my_queue, i))
my_queue[i] = "some state"

You don't need the clients internal sequence number.

@rpcope1
Copy link
Contributor Author

rpcope1 commented Sep 19, 2014

For doing debug, especially against the drive, I think it would be good to have the ability to explicitly expose the sequence numbers. I also think the development team agrees with this, as it allows you to look inside the drive or simulator and match up requests on the drive/simulator to requests at the client level.

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

No branches or pull requests

2 participants