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

Multithreaded event handling for agents #153

Closed
2 of 3 tasks
Autoparallel opened this issue Mar 22, 2023 · 2 comments · Fixed by #181
Closed
2 of 3 tasks

Multithreaded event handling for agents #153

Autoparallel opened this issue Mar 22, 2023 · 2 comments · Fixed by #181
Assignees

Comments

@Autoparallel
Copy link
Collaborator

Autoparallel commented Mar 22, 2023

This issue came up in thinking about how to allow agents to asynchronously await events in order to dictate their actions. There are likely multiple ways to accomplish this, but here's an outline.

  • Allow the SimulationEnvironment to own write control over a buffer where events are written. Upon any call to execution, events should be echoed into this buffer.
  • Agents need read only access to the buffer and as such they can read from this buffer without the buffer needing to be mutex since agents will not write -- only the environment/EVM instance will write. Agents need a function to access these logs.
  • Agents will also need some type of async await function that lets them constantly poll for updates in event logs.
@Autoparallel
Copy link
Collaborator Author

The event_buffer should only store the head and not grow deeper.

@0xJepsen 0xJepsen added this to the Simulation Testing milestone Mar 27, 2023
@Autoparallel
Copy link
Collaborator Author

Going to attempt the async function on this now and double check the threading is working properly with a test.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants