Skip to content

v0.3.0

Compare
Choose a tag to compare
@andy9775 andy9775 released this 08 Aug 01:12
· 33 commits to master since this release

v0.3.0 includes:

  • NewResultMap constructor accepts a int capacity rather than keys array
  • Minimize Keys interface
    • remove Identifiers and UniqueIdentifiers methods
    • Keys method now returns a []interface{} after calling the Raw method of
      each key
  • Check raw value of Key before adding to key store
  • Add LoadNoOp to Strategy interface and implement for all strategies.
    LoadNoOp is called when the dataloader returns the requested result from the
    cache. LoadNoOp should increment the loads counter and not return anything.
  • Update Cache interface to include Delete and ClearAll which return a
    boolean. Cache interface should also thread context through the methods.
  • Remove unused struct fields
  • Remove mutex from key store. Keys are added to the key store in a single
    worker go routine therefore concurrent access under normal use is not
    possible.
  • Remove mutex from Counter. Counter will no longer be updated from multiple
    go routines.
  • Remove mutex from ResultMap as it will no longer be accessed in multiple go
    routines.
  • Remove MergeWith method from ResultMap as it a basic wrapper around a for
    loop.
  • Update strategy and dataloader to return callback functions (Thunk and
    ThunkMany). Returning callback functions allow Load/LoadMany to be called
    without blocking but still trigger a worker go routine which can trigger the
    batch function if capacity is hit. Results can then be fetched from after
    calling the returned callbacks.
  • Implement Once strategy whose purpose is to wrap around calls to the batch
    function or to trigger a background worker to call the batch function. This
    allows for a consistent api throughout projects using the dataloader if a single
    use dataloader is useful.
  • Fix race conditions in strategies.
  • add tests.