-
Couldn't load subscription status.
- Fork 216
Update Filesystem client to make async invocations (C#) #324
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
Conversation
| { | ||
| Debug.Assert(node is not null); // The node proxies returned by list() are never null. | ||
|
|
||
| // TODO: should be an async call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should generate a checkedCastAsync ... anything else would be inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding checkedCastAsync sounds good. On a side note the Slice model for this example isn't great.
I wondering if we should add a NodeInfo struct and NodeKind enum:
enum NodeKind
{
File,
Directory
}
struct NodeInfo
{
string name;
NodeKind kind;
Node* node;
}
sequence<NodeInfo> NodeInfoSeq;
interface Directory extends Node
{
idempotent NodeInfoSeq list();
}
This avoids the need for separate name, checkedCast requests.
| { | ||
| Debug.Assert(node is not null); // The node proxies returned by list() are never null. | ||
|
|
||
| // TODO: should be an async call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding checkedCastAsync sounds good. On a side note the Slice model for this example isn't great.
I wondering if we should add a NodeInfo struct and NodeKind enum:
enum NodeKind
{
File,
Directory
}
struct NodeInfo
{
string name;
NodeKind kind;
Node* node;
}
sequence<NodeInfo> NodeInfoSeq;
interface Directory extends Node
{
idempotent NodeInfoSeq list();
}
This avoids the need for separate name, checkedCast requests.
| string kind = subdir is not null ? "directory" : "file"; | ||
|
|
||
| Console.WriteLine($"{indent}{node.Name()} {kind}:"); | ||
| Console.WriteLine($"{indent}{await node.NameAsync()} {kind}:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a name variable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This demo is really about the power of inheritance. And implementation reuse in C++. So I would not change the model or the checkedCast[Async].
Fixes #308.