Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Colin/agents-threaded-event-reader #181

Merged
merged 12 commits into from
Apr 6, 2023
Merged

Colin/agents-threaded-event-reader #181

merged 12 commits into from
Apr 6, 2023

Conversation

Autoparallel
Copy link
Collaborator

Attempting to close #153.

Still need to build the functionality of actually awaiting new events. Trying to model this after ethers.

Copy link
Collaborator

@0xJepsen 0xJepsen left a comment

Choose a reason for hiding this comment

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

This looks good to me other than the lint failing, what other things need to be done on this PR?

Going to see if I can remove Arc<RwLock<EVM>> now.
No more async, arc, rwlock needed now.
@Autoparallel
Copy link
Collaborator Author

This looks good to me other than the lint failing, what other things need to be done on this PR?

It was not very clean at that point -- just working. I cleaned it up and it's looking good now. Opening PR now.

@Autoparallel
Copy link
Collaborator Author

Closes #153

@Autoparallel Autoparallel marked this pull request as ready for review April 5, 2023 19:15
@Autoparallel Autoparallel changed the title Colin/agents async Colin/agents-threaded-event-reader Apr 5, 2023
@Autoparallel
Copy link
Collaborator Author

I need to set up dispatching so messages aren't consumed on other threads. Working on this now.

@Autoparallel
Copy link
Collaborator Author

I think this should close it. See the reworked test.

@Autoparallel Autoparallel requested a review from 0xJepsen April 5, 2023 22:38
Copy link
Collaborator

@0xJepsen 0xJepsen left a comment

Choose a reason for hiding this comment

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

lgtm!

let writer_base_contract_for_admin = writer.base_contract.clone();
let admin_handle = thread::spawn(move || {
let mut i = 0;
while let Ok(logs) = reader_for_admin.recv() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@0xJepsen 0xJepsen merged commit 8af3ff7 into main Apr 6, 2023
@0xJepsen 0xJepsen deleted the colin/agents-async branch April 10, 2023 11:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multithreaded event handling for agents
2 participants