-
Notifications
You must be signed in to change notification settings - Fork 31
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
Servers and clients need a way to skip flattening/unflattening if not needed #65
Comments
Dare I suggest: LazyList? |
LazyList was a half-hearted attempt to do something like this, but it only skipped unflattening lists. I'm thinking of something more drastic here, more inline with how the delphi and java apis work, where you really just have an opaque Data object that is essentially just raw bytes. |
Why not just make flattening and unflattening cheap enough that it doesn't @pomalley: very funny. I think the right way to do this is to make it explicit. Make a variant of On Wed, Feb 11, 2015 at 7:10 PM, Matthew Neeley notifications@github.com
|
Even if unflattening is cheap, what are you unflattening to? You need a lossless representation of the labrad data, so why not just operate on the bytes directly. Also, as mentioned in #66, it would be nice to uncouple the python representation so the user can unflatten in different ways. Agree that explicit is better than implicit, and I was thinking along the same lines of modifying the setting decorator. Similarly, could have some kind of flag for clients who make a request and want the result to not get unflattened. |
Well, we want a low overhead way to do the flatten/unflatten paths in any On Wed, Feb 11, 2015 at 7:22 PM, Matthew Neeley notifications@github.com
|
While this will solve the immediate problem with the datavault and will also help in the case where a server just wants to forward a request or response elsewhere, I think we may be conflating two ideas here. Independently of whether or not we keep the underlying binary data, I'd think we want to guarantee that Keeping the binary string available seems like a totally independent consideration (although it does provide LosslessnessTM by construction). It's independent because users aren't going to want binary data, they want python objects, so there has to be a lossless binary->python and python->binary mapping anyway. |
If we do this, I propose only supporting it in the asynchronous This is what I propose as a syntax for this: @setting(10, _raw=True, accepts=['_s', '_v[GHz]'], returns=['_i_v[]]) I haven't looked in pylabrad enough recently to know how ugly this is. It On Wed, Feb 11, 2015 at 10:25 PM, Daniel Sank notifications@github.com
|
Why the underscore in |
@ejeffrey why only for the asynchronous interfaces and what do you mean by "build it into the packet data structure"? |
Well, currently the async and syncronous interfaces are largely separate I just mean that we can require using the explicit packet syntax to request I used _raw to prevent confusion with argument names, but I actually think Evan On Thu, Feb 12, 2015 at 8:35 AM, Matthew Neeley notifications@github.com
|
Ah, makes sense. When you said "packet data structure" I thought you were referring to bytes on the wire. |
For servers that just want to pass data along or store it in a lossless way, it would be nice to be able to avoid incurring the cost of flattening/unflattening data.
The text was updated successfully, but these errors were encountered: