Skip to content

Commit

Permalink
update hazelcast example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
semihbkgr committed Jun 11, 2024
1 parent c8d4460 commit e5f543b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,12 @@ if err != nil {
log.Fatalf("Failed to start client: %v", err)
}

hzMapName:= "gocache"
hzMap, err := hzClient.GetMap(ctx, "gocache")
if err != nil {
b.Fatalf("Failed to get map: %v", err)
}

hazelcastStore := hazelcast_store.NewHazelcast(hzClient, hzMapName)
hazelcastStore := hazelcast_store.NewHazelcast(hzMap)

cacheManager := cache.New[string](hazelcastStore)
err := cacheManager.Set(ctx, "my-key", "my-value", store.WithExpiration(15*time.Second))
Expand Down

0 comments on commit e5f543b

Please sign in to comment.