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

feat: add Send and Receive #199

Closed
wants to merge 6 commits into from
Closed

feat: add Send and Receive #199

wants to merge 6 commits into from

Conversation

uweeby
Copy link
Member

@uweeby uweeby commented Apr 26, 2020

Took a shot at adding as much of this as I could figure out. Clearly not done yet.

@uweeby uweeby added the Work In Progess Shouldn't be merged yet label Apr 26, 2020
Comment on lines 17 to 20
void RegisterHandler<T1, T2>(Action<T1> handler) where T1 : IMessageBase where T2 : IMessageBase, new();

void RegisterHandler<T1, T2>(Action<INetworkConnection, T1> handler) where T1 : IMessageBase where T2 : IMessageBase, new();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would register a function in this case that returns T2

Suggested change
void RegisterHandler<T1, T2>(Action<T1> handler) where T1 : IMessageBase where T2 : IMessageBase, new();
void RegisterHandler<T1, T2>(Action<INetworkConnection, T1> handler) where T1 : IMessageBase where T2 : IMessageBase, new();
void RegisterHandler<T1, T2>(Func<T1, T2> handler) where T1 : IMessageBase where T2 : IMessageBase, new();
void RegisterHandler<T1, T2>(Func<INetworkConnection, T1, T2> handler) where T1 : IMessageBase where T2 : IMessageBase, new();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed this and it helped me solve more of the puzzle. But now I am unsure what to do with: MessageHandler(handler). I think we need a new version of that.

@uweeby uweeby closed this Jul 13, 2020
@uweeby uweeby deleted the sendAndReceive branch July 13, 2020 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Work In Progess Shouldn't be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants