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

Dynamic proxies for agents #76

Open
bojidar-bg opened this issue Feb 17, 2021 · 0 comments
Open

Dynamic proxies for agents #76

bojidar-bg opened this issue Feb 17, 2021 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@bojidar-bg
Copy link
Collaborator

It might be nice to have a dynamic proxy for IAgent-s, so that code which uses a remote agent is cleaner.
For example, this would allow writing:

dynamic agentProxy = ...;
Assert.Equals((int)await agentProxy.Neg(1), -1);
Assert.Equals((int)await agent.Add(1, 2), 3);
await agent.Print("test");

instead of:

IAgent agent = ...;
Assert.Equals(await agent.CallFunctionAsync<int>("Neg", 1), -1);
Assert.Equals(await agent.CallFunctionAsync<int>("Add", (1, 2)), 3);
await agent.CallActionAsync<int>("Print", "test")

(Note that for return types, we should probably use a second dynamic proxy as outlined in this StackOverflow question; see also #75)

@bojidar-bg bojidar-bg added the enhancement New feature or request label Feb 17, 2021
@bojidar-bg bojidar-bg added the question Further information is requested label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant