MCPcopy
hub / github.com/olric-data/olric / Expire

Method Expire

pipeline.go:272–282  ·  view source on GitHub ↗

Expire queues an Expire command. The parameters are identical to the DMap.Expire, but it returns FutureExpire to read the batched response.

(ctx context.Context, key string, timeout time.Duration)

Source from the content-addressed store, hash-verified

270// Expire queues an Expire command. The parameters are identical to the DMap.Expire,
271// but it returns FutureExpire to read the batched response.
272func (dp *DMapPipeline) Expire(ctx context.Context, key string, timeout time.Duration) (*FutureExpire, error) {
273 cmd := protocol.NewExpire(dp.dm.name, key, timeout).Command(ctx)
274 partID, index := dp.addCommand(key, cmd)
275 return &FutureExpire{
276 dp: dp,
277 partID: partID,
278 index: index,
279 ctx: dp.ctx,
280 closedCtx: dp.closedCtx,
281 }, nil
282}
283
284// FutureIncr is used to read the result of a pipelined Incr command.
285type FutureIncr struct {

Callers

nothing calls this directly

Calls 3

addCommandMethod · 0.95
NewExpireFunction · 0.92
CommandMethod · 0.45

Tested by

no test coverage detected