scylladb / scylla-go-driver

Experimental, high performance Scylla Driver, University of Warsaw students' project
Apache License 2.0
151 stars 7 forks source link

transport: use go 1.19 atomic.Pointer instead of atomic.Value #284

Open Kulezi opened 2 years ago

Kulezi commented 2 years ago

Currently transport package atomically replaces topology and connections with new ones. This is done using atomic.Value that hold topology and conn pointers, this is not type-safe and requires type assertions every time the driver needs the values hidden in atomic.Value.

Go 1.19 introduces a generic atomic.Pointer[T], that is a more suitable replacement, adding type-safety and removing the type assertions,

This PR replaces mentioned atomic.Values with the new generic atomic pointer type.

Fixes #269