Skip to content

refactor(abstract): Remove sync command methods and unsupported SER stubs#267

Merged
currantw merged 6 commits intovalkey-io:mainfrom
currantw:currantw/remove-sync-idatabase-methods
Apr 6, 2026
Merged

refactor(abstract): Remove sync command methods and unsupported SER stubs#267
currantw merged 6 commits intovalkey-io:mainfrom
currantw:currantw/remove-sync-idatabase-methods

Conversation

@currantw
Copy link
Copy Markdown
Collaborator

@currantw currantw commented Apr 3, 2026

Summary

Remove synchronous .GetAwaiter().GetResult() wrapper methods and unsupported SER compatibility stubs from the abstract layer.

Issue Link

Closes #264

Features and Behaviour Changes

  • IDatabase no longer declares sync Execute or ScriptEvaluate methods. It now only extends IDatabaseAsync and adds CreateBatch and CreateTransaction.
  • IServer no longer declares sync Execute or InfoRaw methods.
  • ISubscriber no longer declares sync Publish, Subscribe, Unsubscribe, or UnsubscribeAll methods. The interface now declares only async methods.
  • ITransaction retains sync Execute for consistency with IBatch.Execute() (both are SER-compatibility entry points for batching/transactions).
  • LuaScript no longer has sync Evaluate or Load methods.
  • LoadedLuaScript no longer has a sync Evaluate method.
  • Unsupported SER stubs marked [Obsolete(error: true)] are removed from ISubscriber, Subscriber, ValkeyChannel, and IStreamCommands.

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 sync Execute + 4 sync ScriptEvaluate overloads.
  • IServer / ValkeyServer: Removed 2 sync Execute + sync InfoRaw.
  • ISubscriber / Subscriber: Removed 5 sync pub/sub methods; restructured interface to declare async methods directly with standalone XML docs.
  • ITransaction / ValkeyTransaction: Retained sync Execute (consistent with IBatch.Execute()); simplified ExecuteAsync XML doc to inheritdoc.
  • LuaScript: Removed sync Evaluate and sync Load.
  • LoadedLuaScript: Removed sync Evaluate.
  • IStreamCommands / ValkeyChannel / ISubscriber: Removed [Obsolete(error: true)] stubs for unsupported SER methods.

Tests updated:

  • StandaloneClientTests: Sync db.Execute(...) calls converted to await db.ExecuteAsync(...).
  • LoadedLuaScriptTests: Removed sync Evaluate null-check test.

Limitations

⚪ None

Testing

  • Existing unit and integration tests updated to use async equivalents.
  • Removed tests that exercised deleted sync methods.
  • Build, format, and lint checks all pass.

Related Issues

⚪ None

Checklist

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated and all checks pass.
  • CHANGELOG.md, README.md, DEVELOPER.md, and other documentation files are updated. No documentation changes needed — this is an internal API cleanup with no user-facing doc impact.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

currantw added 4 commits April 2, 2026 21:48
…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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ScriptEvaluate from IDatabase/Database, sync Execute/InfoRaw from IServer/ValkeyServer, and sync pub/sub methods from ISubscriber/Subscriber.
  • Removed sync Evaluate/Load APIs from LuaScript and sync Evaluate from LoadedLuaScript; updated tests to use async equivalents.
  • Removed [Obsolete(error: true)] unsupported SER stub declarations from IStreamCommands and ValkeyChannel.

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 currantw requested review from alexr-bq and xShinnRyuu April 3, 2026 22:14
Signed-off-by: currantw <taylor.curran@improving.com>
@currantw currantw merged commit 4c090fa into valkey-io:main Apr 6, 2026
21 of 22 checks passed
@currantw currantw deleted the currantw/remove-sync-idatabase-methods branch April 6, 2026 18:45
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.

refactor(abstract): Remove sync command methods from IDatabase

4 participants