.NET Client Documentation
5.3.0
Search Results for

    Show / Hide Table of Contents

    TryPutAsync Method

    TryPutAsync(TKey, TValue, TimeSpan)

    Tries to set (add or update) an entry.

    Declaration
    Task<bool> TryPutAsync(TKey key, TValue value, TimeSpan timeToWait)
    Parameters
    TKey key

    A key.

    TValue value

    A value.

    TimeSpan timeToWait

    How long to wait (-1ms to wait forever; 0ms to not wait at all).

    Returns
    Task<bool>

    true if the entry was set; otherwise false.

    Remarks

    If the entry is not immediately available, because a lock is set on the key, this will wait for the specified timeToWait for the lock. If the lock cannot be acquired in time, returns null. If timeToWait is -1ms, waits forever. If it is 0ms, does not wait at all.

    In This Article
    Back to top Copyright © 2010-2023 Hazelcast, Inc. All rights reserved.
    Generated by DocFX.