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

WIP - Async commands #144

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

perzanko
Copy link
Contributor

@perzanko perzanko commented May 21, 2019

ref: #43
In progres...


// Handle response arguments to issued command
fn execute_message<M: ChannelMessageMode>(&mut self) {
let channel_result = M::handle(Box::leak(self.message.clone().into_boxed_str()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unsafe, It should be avoided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just workaround for testing...

{
self.thread_pool.lock().unwrap().scope(|s| {
s.spawn(move |_| func());
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

scope is executing tasks within scoped thread pool, the thing is that this operation blocks the main thread. I need to rework that.

@perzanko
Copy link
Contributor Author

@valeriansaliou I've done some things and almost succeed. There is one thing that is still blocking asynchronous execution, but I have already plan how to solve it. Could you make a code review?
Do I go in the right direction?

Copy link
Contributor Author

@perzanko perzanko left a comment

Choose a reason for hiding this comment

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

The build is not passing, because of feature(fnbox) - use FnMut instead..

Copy link
Contributor Author

@perzanko perzanko left a comment

Choose a reason for hiding this comment

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

Still no unit/integration tests...

@valeriansaliou
Copy link
Owner

Thanks a ton!! I’ll be reviewing this soon, had no chance so far as my week is unusually busy with Crisp.

@valeriansaliou
Copy link
Owner

@valeriansaliou I've done some things and almost succeed. There is one thing that is still blocking asynchronous execution, but I have already plan how to solve it. Could you make a code review?
Do I go in the right direction?

I could give your changes a quick look, and they look good to me. I'd say you can continue on this path!

@perzanko
Copy link
Contributor Author

Great, I will!

@valeriansaliou valeriansaliou self-assigned this May 24, 2019
@valeriansaliou valeriansaliou added the please review PRs that are pending review label May 24, 2019
@valeriansaliou
Copy link
Owner

Keep me posted on your progress on this one, I have a bit more time for reviews :)

@perzanko
Copy link
Contributor Author

perzanko commented Jun 4, 2019

Fine, I need to find some time

@XVilka
Copy link

XVilka commented Oct 8, 2019

There are conflicts to resolve, and probably some changes might be required due to the latest Rust async improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review PRs that are pending review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants