-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add IChunkWebSocketUploader and refactor
- Loading branch information
Showing
4 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2021-present Etherna SA | ||
// This file is part of Bee.Net. | ||
// | ||
// Bee.Net is free software: you can redistribute it and/or modify it under the terms of the | ||
// GNU Lesser General Public License as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// Bee.Net is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License along with Bee.Net. | ||
// If not, see <https://www.gnu.org/licenses/>. | ||
|
||
using Etherna.BeeNet.Models; | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Etherna.BeeNet.Tools | ||
{ | ||
public interface IChunkWebSocketUploader : IDisposable | ||
{ | ||
Task CloseAsync(); | ||
|
||
Task SendChunkAsync( | ||
byte[] chunkPayload, | ||
CancellationToken cancellationToken); | ||
|
||
Task SendChunkAsync( | ||
SwarmChunk chunk, | ||
CancellationToken cancellationToken); | ||
|
||
Task SendChunkBatchAsync( | ||
SwarmChunk[] chunkBatch, | ||
bool isLastBatch, | ||
CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains 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