-
Notifications
You must be signed in to change notification settings - Fork 105
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
add trade-engine example #82
Conversation
Thanks for this. This is pretty cool. Just briefly looking at it, I see that the trade engine spins off a goroutine as a long running process. This seems problematic as there is no locking involved and you have to goroutines which both operate on the same data. Wouldn't it make more sense to do the work in the receiver? This will mean that there'll be times where you won't be able to process requests while it is working, but that is a problem anyways. Have you tried running it with the race flag enabled? |
Thanks @perbu , I have fixed the race condition so it should be ok now. Let me know if there is anything else needed 👍 |
@anthdm I think we should merge this. We need a couple of non-trivial examples anyways. My suggestion would be that we merge this, then start moving the examples into a new repo. Maybe also merge one of the websocket examples while we're at it. |
The commit updates the trade engine by replacing Unix timestamp format with Go's native time.Time. This affects order expiry and price update time tracking in the system. It's a better practice for readability and consistency in Go, and will also handle different time zones effectively. A logging line deemed excessively verbose was also commented out for cleanliness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
adding simple example
Also add .DS_Store to gitignore