options

package
v3.73.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireSemaphoreOption

type AcquireSemaphoreOption func(c *Ydb_Coordination.SessionRequest_AcquireSemaphore)

AcquireSemaphoreOption configures how we acquire a semaphore.

func WithAcquireData

func WithAcquireData(data []byte) AcquireSemaphoreOption

WithAcquireData returns an AcquireSemaphoreOption which attaches user-defined data to the operation.

func WithAcquireInfiniteTimeout

func WithAcquireInfiniteTimeout() AcquireSemaphoreOption

WithAcquireInfiniteTimeout returns an AcquireSemaphoreOption which disables the timeout after which the operation fails if it is still waiting in the queue.

This is the default behavior. You can set the specific timeout by calling the WithAcquireTimeout method.

func WithAcquireTimeout

func WithAcquireTimeout(timeout time.Duration) AcquireSemaphoreOption

WithAcquireTimeout returns an AcquireSemaphoreOption which sets the timeout after which the operation fails if it is still waiting in the queue. Use 0 to make the AcquireSemaphore method fail immediately if the semaphore is already acquired by another session.

If this is not set, the client waits for the acquire operation result until the operation or session context is done. You can reset the default value of this timeout by calling the WithAcquireInfiniteTimeout method.

func WithEphemeral

func WithEphemeral(ephemeral bool) AcquireSemaphoreOption

WithEphemeral returns an AcquireSemaphoreOption that causes to create an ephemeral semaphore.

Ephemeral semaphores are created with the first acquire operation and automatically deleted with the last release operation. Ephemeral semaphore are always created with the limit of coordination.MaxSemaphoreLimit.

type CreateSemaphoreOption

type CreateSemaphoreOption func(c *Ydb_Coordination.SessionRequest_CreateSemaphore)

CreateSemaphoreOption configures how we create a semaphore.

func WithCreateData

func WithCreateData(data []byte) CreateSemaphoreOption

WithCreateData return a CreateSemaphoreOption which attaches user-defined data to the semaphore.

type CreateSessionOptions

type CreateSessionOptions struct {
	Description             string
	SessionTimeout          time.Duration
	SessionStartTimeout     time.Duration
	SessionStopTimeout      time.Duration
	SessionKeepAliveTimeout time.Duration
	SessionReconnectDelay   time.Duration
}

CreateSessionOptions configure an Session call. CreateSessionOptions are set by the SessionOption values passed to the Session function.

type DeleteSemaphoreOption

type DeleteSemaphoreOption func(c *Ydb_Coordination.SessionRequest_DeleteSemaphore)

DeleteSemaphoreOption configures how we delete a semaphore.

func WithForceDelete

func WithForceDelete(force bool) DeleteSemaphoreOption

WithForceDelete return a DeleteSemaphoreOption which allows to delete a semaphore even if it is currently acquired by other sessions.

type DescribeSemaphoreOption

type DescribeSemaphoreOption func(c *Ydb_Coordination.SessionRequest_DescribeSemaphore)

DescribeSemaphoreOption configures how we update a semaphore.

func WithDescribeOwners

func WithDescribeOwners(describeOwners bool) DescribeSemaphoreOption

WithDescribeOwners return a DescribeSemaphoreOption which causes server send the list of owners in the response to the DescribeSemaphore request.

func WithDescribeWaiters

func WithDescribeWaiters(describeWaiters bool) DescribeSemaphoreOption

WithDescribeWaiters return a DescribeSemaphoreOption which causes server send the list of waiters in the response to the DescribeSemaphore request.

type SessionOption added in v3.61.1

type SessionOption func(c *CreateSessionOptions)

SessionOption configures how we create a new session.

func WithDescription

func WithDescription(description string) SessionOption

WithDescription returns an SessionOption that specifies a user-defined description that may be used to describe the client.

func WithSessionKeepAliveTimeout

func WithSessionKeepAliveTimeout(timeout time.Duration) SessionOption

WithSessionKeepAliveTimeout returns an SessionOption that specifies the time that the client will wait before it terminates the gRPC stream and tries to reconnect if no successful responses have been received from the server.

If this is not set, the client uses the default time 10 seconds.

func WithSessionReconnectDelay

func WithSessionReconnectDelay(delay time.Duration) SessionOption

WithSessionReconnectDelay returns an SessionOption that specifies the time that the client will wait before it tries to reconnect the underlying gRPC stream in case of error.

If this is not set, the client uses the default time 500 milliseconds.

func WithSessionStartTimeout

func WithSessionStartTimeout(timeout time.Duration) SessionOption

WithSessionStartTimeout returns an SessionOption that specifies the time that the client should wait for a response to the StartSession request from the server before it terminates the gRPC stream and tries to reconnect.

If this is not set, the client uses the default time 1 second.

func WithSessionStopTimeout

func WithSessionStopTimeout(timeout time.Duration) SessionOption

WithSessionStopTimeout returns an SessionOption that specifies the time that the client should wait for a response to the StopSession request from the server before it terminates the gRPC stream and tries to reconnect.

If this is not set, the client uses the default time 1 second.

func WithSessionTimeout

func WithSessionTimeout(timeout time.Duration) SessionOption

WithSessionTimeout returns an SessionOption that specifies the timeout during which client may restore a detached session. The client is forced to terminate the session if the last successful session request occurred earlier than this time.

If this is not set, the client uses the default 5 seconds.

type UpdateSemaphoreOption

type UpdateSemaphoreOption func(c *Ydb_Coordination.SessionRequest_UpdateSemaphore)

UpdateSemaphoreOption configures how we update a semaphore.

func WithUpdateData

func WithUpdateData(data []byte) UpdateSemaphoreOption

WithUpdateData return a UpdateSemaphoreOption which changes user-defined data in the semaphore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL