refactor(abstract): Remove sync command methods and unsupported SER stubs#267
Merged
currantw merged 6 commits intovalkey-io:mainfrom Apr 6, 2026
Merged
Conversation
…lated classes Remove synchronous Execute, ScriptEvaluate, and Evaluate methods from IDatabase, Database, LuaScript, and LoadedLuaScript. These were thin .GetAwaiter().GetResult() wrappers that added no value and misled users into expecting a full sync API surface. - Remove 2 sync Execute overloads from IDatabase - Remove 4 sync ScriptEvaluate overloads from IDatabase - Remove 4 sync ScriptEvaluate implementations from Database - Remove 2 sync Execute implementations from Database - Remove sync Evaluate from LuaScript and LoadedLuaScript - Convert sync Execute calls to async in StandaloneClientTests - Remove sync Evaluate test from LoadedLuaScriptTests IDatabase now only declares CreateBatch and CreateTransaction beyond IDatabaseAsync inheritance. Signed-off-by: currantw <taylor.curran@improving.com>
…nd LuaScript Remove sync .GetAwaiter().GetResult() I/O wrappers from ValkeyServer, Subscriber, and LuaScript. These methods added no value over their async equivalents. - Remove 2 sync Execute overloads from IServer and ValkeyServer - Remove sync InfoRaw from IServer and ValkeyServer - Remove sync Publish, Subscribe, Unsubscribe, UnsubscribeAll from ISubscriber and Subscriber - Remove sync Load from LuaScript - Update IServer and ISubscriber XML docs (replace broken inheritdoc refs with standalone docs) Signed-off-by: currantw <taylor.curran@improving.com>
…ransaction Remove sync bool Execute(CommandFlags) from ITransaction and its implementation in ValkeyTransaction. Convert all transaction.Execute() calls in BatchTests.cs to await transaction.ExecuteAsync(). IBatch.Execute() (void) is retained as it has no async equivalent in StackExchange.Redis and serves as the batch flush mechanism. Signed-off-by: currantw <taylor.curran@improving.com>
Remove all [Obsolete(error: true)] methods that throw NotSupportedException or NotImplementedException. These were dead stubs for SER methods that Valkey GLIDE does not support. - Remove IsConnected, IdentifyEndpoint, IdentifyEndpointAsync, SubscribedEndpoint from ISubscriber and Subscriber - Remove WithKeyRouting, implicit operator string, implicit operator byte[] from ValkeyChannel - Remove StreamAcknowledgeAndDeleteAsync, StreamDeleteAsync(mode), StreamAddAsync(mode), StreamTrimAsync(mode) from IStreamCommands Signed-off-by: currantw <taylor.curran@improving.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the abstract API layer to be async-first by removing synchronous .GetAwaiter().GetResult() wrappers and deleting unsupported StackExchange.Redis compatibility stubs, reducing dead/unsupported surface area while keeping batching/transactions entry points.
Changes:
- Removed sync
Execute/ScriptEvaluatefromIDatabase/Database, syncExecute/InfoRawfromIServer/ValkeyServer, and sync pub/sub methods fromISubscriber/Subscriber. - Removed sync
Evaluate/LoadAPIs fromLuaScriptand syncEvaluatefromLoadedLuaScript; updated tests to use async equivalents. - Removed
[Obsolete(error: true)]unsupported SER stub declarations fromIStreamCommandsandValkeyChannel.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Valkey.Glide.UnitTests/LoadedLuaScriptTests.cs | Removes test for deleted sync LoadedLuaScript.Evaluate; keeps async null-guard coverage. |
| tests/Valkey.Glide.IntegrationTests/StandaloneClientTests.cs | Converts sync db.Execute(...) usage to await db.ExecuteAsync(...). |
| sources/Valkey.Glide/Commands/IStreamCommands.cs | Removes unsupported obsolete stream stub members from the interface. |
| sources/Valkey.Glide/Abstract/ValkeyServer.cs | Removes sync Execute and InfoRaw wrappers; keeps async-only API. |
| sources/Valkey.Glide/Abstract/Subscriber.cs | Removes sync pub/sub wrappers and unsupported stub methods from implementation. |
| sources/Valkey.Glide/Abstract/LuaScript.cs | Removes sync Evaluate/Load, leaving async-only script execution/loading. |
| sources/Valkey.Glide/Abstract/LoadedLuaScript.cs | Removes sync Evaluate, leaving async-only evaluation. |
| sources/Valkey.Glide/Abstract/ITransaction.cs | Simplifies ExecuteAsync XML docs to inherit from sync Execute. |
| sources/Valkey.Glide/Abstract/ISubscriber.cs | Restructures interface to declare async pub/sub methods only; removes unsupported stubs. |
| sources/Valkey.Glide/Abstract/IServer.cs | Removes sync Execute overloads and InfoRaw; async-only remains. |
| sources/Valkey.Glide/Abstract/IDatabase.cs | Removes sync Execute and sync SER ScriptEvaluate overloads; keeps batch/transaction factories. |
| sources/Valkey.Glide/Abstract/Database.ScriptingCommands.cs | Removes sync ScriptEvaluate wrappers; retains async with flags guard. |
| sources/Valkey.Glide/Abstract/Database.cs | Removes sync Execute wrappers; retains async ExecuteAsync. |
| sources/Valkey.Glide/abstract_APITypes/ValkeyChannel.cs | Removes unsupported obsolete SER members (routing + implicit conversions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: currantw <taylor.curran@improving.com>
currantw
commented
Apr 3, 2026
Signed-off-by: currantw <taylor.curran@improving.com>
alexr-bq
approved these changes
Apr 4, 2026
xShinnRyuu
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove synchronous
.GetAwaiter().GetResult()wrapper methods and unsupported SER compatibility stubs from the abstract layer.Issue Link
Closes #264
Features and Behaviour Changes
IDatabaseno longer declares syncExecuteorScriptEvaluatemethods. It now only extendsIDatabaseAsyncand addsCreateBatchandCreateTransaction.IServerno longer declares syncExecuteorInfoRawmethods.ISubscriberno longer declares syncPublish,Subscribe,Unsubscribe, orUnsubscribeAllmethods. The interface now declares only async methods.ITransactionretains syncExecutefor consistency withIBatch.Execute()(both are SER-compatibility entry points for batching/transactions).LuaScriptno longer has syncEvaluateorLoadmethods.LoadedLuaScriptno longer has a syncEvaluatemethod.[Obsolete(error: true)]are removed fromISubscriber,Subscriber,ValkeyChannel, andIStreamCommands.Implementation
All removed sync methods were thin
.GetAwaiter().GetResult()wrappers over their async counterparts. The removal is straightforward — interface declarations, implementations, and associated tests are deleted or converted to async.Key areas:
IDatabase/Database/Database.ScriptingCommands: Removed 2 syncExecute+ 4 syncScriptEvaluateoverloads.IServer/ValkeyServer: Removed 2 syncExecute+ syncInfoRaw.ISubscriber/Subscriber: Removed 5 sync pub/sub methods; restructured interface to declare async methods directly with standalone XML docs.ITransaction/ValkeyTransaction: Retained syncExecute(consistent withIBatch.Execute()); simplifiedExecuteAsyncXML doc toinheritdoc.LuaScript: Removed syncEvaluateand syncLoad.LoadedLuaScript: Removed syncEvaluate.IStreamCommands/ValkeyChannel/ISubscriber: Removed[Obsolete(error: true)]stubs for unsupported SER methods.Tests updated:
StandaloneClientTests: Syncdb.Execute(...)calls converted toawait db.ExecuteAsync(...).LoadedLuaScriptTests: Removed syncEvaluatenull-check test.Limitations
⚪ None
Testing
Related Issues
⚪ None
Checklist
No documentation changes needed — this is an internal API cleanup with no user-facing doc impact.CHANGELOG.md,README.md,DEVELOPER.md, and other documentation files are updated.mainor releasemain, squash otherwise.