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

MVP: Ability to specify a file to write to. #98

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

MVP: Ability to specify a file to write to. #98

wants to merge 4 commits into from

Conversation

hbina
Copy link
Contributor

@hbina hbina commented Nov 19, 2020

This PR comes with a lot of code changes. It is becoming quite unwieldy, maybe consider a refactoring? Like I think the key parsing thing is perfect, I don't want to keep seeing it.

TODO:

  1. Clear out the writer buffer before we exit.
  2. I think HashMap is better than Vec here because we keep trying to access this from different threads. But I am just guessing here.
  3. Unify the backing buffer used by writer and grapher so we don't use twice as much memory.
  4. Maybe figure out a way to not use so many mutexes and so many allocations to write stuff.

Now logs the pongs in a buffer.
Next is to use some kinda resize-able ring buffer of sort to put the
pongs in and have a consumer thread.

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
For the moment it will not clear out its buffer when we exit the program.
Will do that in the future.

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
1. Only hold the lock as necessary.
2. Returns immediately from polling for input.

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
Draw shouldn't lock now.

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
@hbina hbina marked this pull request as ready for review November 21, 2020 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant