-
Notifications
You must be signed in to change notification settings - Fork 46
Add Redis Graph Commands #37
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
Conversation
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.
The way that transactions work in here is really wonky.
StackExchange.Redis has this odd pattern where you:
- Create the transaction
- Execute "async" methods against the transaction
- Close the transaction
- pull the results from the tasks that were spawned by the async methods in step 2
this leads to a really weird issue where if you await a non-closing task before the closing task, you'll just deadlock your thread - which isn't great.
Here we have:
- Create the transaction
- Execute 'async' methods against the transaction
- close the transaction
- pull the results from an array of results that is returned when closing out the transaction.
In this model there isn't a great way to correlate the request to the result, and we've lied to the user with those async tasks as the tasks they got back have no deferred result which is really odd. Perhaps those methods shouldn't be called "Async" and shouldn't return any task, maybe "enqueue" or something with some way to correlate the command to the result.
{ | ||
var results = new ResultSet[_pendingTasks.Count]; | ||
|
||
var success = _transaction.Execute(); // TODO: Handle false (which means the transaction didn't succeed.) |
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.
if false this really should throw an aggregation of the error's that came out of the transaction.
/// <summary> | ||
/// Allows for executing a series of RedisGraph queries as a single unit. | ||
/// </summary> | ||
public class RedisGraphTransaction // TODO: check if needed |
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.
check what?
@@ -0,0 +1,172 @@ | |||
// using System.Text; |
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.
remove this.
LGTM 👍 |
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 👍
No description provided.