Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pipeline support #50

Merged
merged 25 commits into from
Jan 29, 2023
Merged

Pipeline support #50

merged 25 commits into from
Jan 29, 2023

Conversation

shacharPash
Copy link
Contributor

No description provided.

@shacharPash shacharPash changed the title add pipeline class & test Pipeline support Dec 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2022

Codecov Report

Base: 93.22% // Head: 93.32% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (c15b780) compared to base (af283a2).
Patch coverage: 94.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   93.22%   93.32%   +0.09%     
==========================================
  Files          66       76      +10     
  Lines        4460     4555      +95     
  Branches      420      422       +2     
==========================================
+ Hits         4158     4251      +93     
- Misses        180      181       +1     
- Partials      122      123       +1     
Impacted Files Coverage Δ
src/NRedisStack/Auxiliary.cs 100.00% <ø> (ø)
src/NRedisStack/Json/JsonCommandBuilder.cs 91.39% <ø> (ø)
src/NRedisStack/Graph/GraphCommandsAsync.cs 87.32% <87.32%> (ø)
src/NRedisStack/Json/JsonCommandsAsync.cs 87.40% <87.40%> (ø)
src/NRedisStack/Search/SearchCommandsAsync.cs 91.46% <91.46%> (ø)
.../NRedisStack/TimeSeries/TimeSeriesCommandsAsync.cs 95.94% <95.94%> (ø)
src/NRedisStack/Bloom/BloomCommands.cs 100.00% <100.00%> (ø)
src/NRedisStack/Bloom/BloomCommandsAsync.cs 100.00% <100.00%> (ø)
src/NRedisStack/CountMinSketch/CmsCommands.cs 100.00% <100.00%> (ø)
src/NRedisStack/CountMinSketch/CmsCommandsAsync.cs 100.00% <100.00%> (ø)
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@shacharPash
Copy link
Contributor Author

shacharPash commented Dec 27, 2022

This is a temporary solution to support pipelines,
The next step is to change the code so that Redis stack commands can be called in this way (or similar):

var pipeline = new Pipeline(db);
pipeline.Json().Set(...);
pipeline.Json().Get(...);

Without .AddCommand(JsonCommandBuilder. like it is right now:

pipeline.AddCommand(JsonCommandBuilder.Set(...));

@chayim chayim self-requested a review January 5, 2023 12:04
@chayim
Copy link
Contributor

chayim commented Jan 19, 2023

@shacharPash did you see the conflict?

@shacharPash
Copy link
Contributor Author

@shacharPash did you see the conflict?

I fixed it now 👍

pipeline.Db.ExecuteAsync("FLUSHALL");

string jsonPerson = JsonSerializer.Serialize(new Person { Name = "Shachar", Age = 23 });
var setResponse = pipeline.Json.SetAsync("key", "$", jsonPerson);
Copy link
Contributor

Choose a reason for hiding this comment

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

perfect

@shacharPash shacharPash mentioned this pull request Jan 26, 2023
6 tasks
@shacharPash shacharPash requested review from chayim and a team January 26, 2023 20:17
@Jeevananthan-23
Copy link
Contributor

Hi @shacharPash, working on pipeline examples and found that ModulePrefix has not been added for some of the module commands except JSON

public class Pipeline
{
    public Pipeline(IConnectionMultiplexer muxer)
    {
        _batch = muxer.GetDatabase().CreateBatch();
    }

    private IBatch _batch;

    public void Execute()
    {
        _batch.Execute();
    }

    public IJsonCommandsAsync Json => new JsonCommandsAsync(_batch); // Json

   public  ISearchCommandsAsync Search => new SearchCommandsAsync(_batch); //search 


    public IDatabaseAsync Db => _batch;
}

@shacharPash
Copy link
Contributor Author

shacharPash commented Jan 29, 2023

Hi @Jeevananthan-23, The reason I haven't added them until now is because I haven't yet added pipeline tests to each of the modules.
Anyway, in the meantime I've added that for each of the modules 👍

Copy link
Contributor

@chayim chayim left a comment

Choose a reason for hiding this comment

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

Ready to merge, if CI passes

@shacharPash shacharPash merged commit 9ffc212 into master Jan 29, 2023
@shacharPash shacharPash deleted the supportPipeline branch January 29, 2023 14:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants