Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Refactor to simplify #3

Merged
merged 3 commits into from
Mar 2, 2019
Merged

Refactor to simplify #3

merged 3 commits into from
Mar 2, 2019

Conversation

lawrencejones
Copy link
Contributor

No description provided.

Remove the need to perform type switches by extending a parsed item's
interface to know how to handle itself. This means we can better
leverage the type system and remove the possibility that we can put
anything into the channel that can't take an appropriate action on the
connection.

Have the Database manage creating connections, and don't pass the
WaitGroup away from the main Database loop. The connection can terminate
itself in response to a Disconnect now, simplifying some of the
termination logic.
It's quite subtle that an Execute log isn't sufficient to resolve how to
run the associated query. This commit removes the Handle method from
Execute to clearly enforce that Execute should not be considered a
complete parsed Item, forcing any code that wants to supply an Execute
with the parameters it should be bound with.
This is a bit of a crap-shoot. I don't want to introduce locks around
accessing the map because this may slow things down, but I definitely
want to have the pending method and that requires reading the map while
risking a concurrent write. I think we're highly unlikely to see any
problems but want to call it out that Pending should be suspect if we
begin to see segfaults.
@lawrencejones lawrencejones merged commit a7723a9 into master Mar 2, 2019
@lawrencejones lawrencejones deleted the lawrence-simplify branch March 2, 2019 22:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant