A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://richardschneider.github.io/net-ipfs-engine/articles/async.html below:

Asynchronous I/O

All requests to the IPFS engine are asynchronous, which does not block current thread.

This means that callers should normally use the async/await paradigm

async Task<Cid> AddText()
{
    var data = await ipfs.FileSystem.AddTextAsync("I am pinned");
    return data.Id;
}

If a synchronous operation is required, then this can work

Cid AddText()
{
    var data = ipfs.FileSystem.AddTextAsync("I am pinned").Result;
    return data.Id;
}

Or use .Wait() instead of .Result when the operation returns nothing.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4