improvement: Pull over future and types util packages #12

Merged
k-simons merged 3 commits from ksimons/addFutures into develop 2025-12-17 21:21:38 +00:00
k-simons commented 2025-12-17 15:23:43 +00:00 (Migrated from github.com)

Summary

  • Adds a new util/async package with generic Future[T] interface for asynchronous operations
  • Adds a new util/types package with generic utility functions for pointer/value conversions

util/async package

  • Future[T] - Generic interface for asynchronous operations with Get(ctx context.Context) (T, error)
  • VoidFuture - Type alias for Future[struct{}] for operations with no return value (inspired by Java's Future)
  • NewFunctionalFuture[T] - Creates a Future from a function
  • MapFuture[T, R] - Transforms a Future[T] to Future[R] using a mapping function

util/types package

  • ToPointer[T] - Returns a pointer to the provided value
  • ToValue[T] - Dereferences a pointer
  • Zero[T] - Returns the zero value of a generic type
Summary - Adds a new util/async package with generic Future[T] interface for asynchronous operations - Adds a new util/types package with generic utility functions for pointer/value conversions util/async package - Future[T] - Generic interface for asynchronous operations with Get(ctx context.Context) (T, error) - VoidFuture - Type alias for Future[struct{}] for operations with no return value (inspired by Java's Future<Void>) - NewFunctionalFuture[T] - Creates a Future from a function - MapFuture[T, R] - Transforms a Future[T] to Future[R] using a mapping function util/types package - ToPointer[T] - Returns a pointer to the provided value - ToValue[T] - Dereferences a pointer - Zero[T] - Returns the zero value of a generic type
changelog-app[bot] commented 2025-12-17 15:23:47 +00:00 (Migrated from github.com)

✅ Successfully generated changelog entry!

Entry generated via PR title

To modify this entry, edit PR title using proper format.


📋Changelog Preview

💡 Improvements

  • Pull over future and types util packages (#12)
### ✅ **Successfully generated changelog entry!** #### Entry generated via PR title To modify this entry, edit PR title using proper format. --- ### 📋Changelog Preview ### 💡 Improvements * Pull over future and types util packages ([#12](https://github.com/palantir/witchcraft-go-tasks/pull/12)) <!-- changelog-success-comment -->
tabboud (Migrated from github.com) approved these changes 2025-12-17 21:21:32 +00:00
autorelease3[bot] commented 2025-12-17 21:21:46 +00:00 (Migrated from github.com)

Released v0.4.0

Released [v0.4.0](https://github.com/palantir/witchcraft-go-tasks/releases/tag/v0.4.0)
Sign in to join this conversation.
No description provided.