Skip to content
Snippets Groups Projects
Select Git revision
  • 3de4b35ffa23c1deb5b28426d6c53f73811c00f3
  • master default protected
2 results

send-coap-TPH.py

Blame
  • objectstorage.go 654 B
    package branchmanager
    
    import (
    	"time"
    
    	"github.com/iotaledger/hive.go/objectstorage"
    )
    
    const (
    	// the following values are a list of prefixes defined as an enum
    	_ byte = iota
    
    	// prefixes used for the objectstorage
    	osBranch
    )
    
    var (
    	osLeakDetectionOption = objectstorage.LeakDetectionEnabled(false, objectstorage.LeakDetectionOptions{
    		MaxConsumersPerObject: 10,
    		MaxConsumerHoldTime:   10 * time.Second,
    	})
    
    	osBranchOptions = []objectstorage.Option{
    		objectstorage.CacheTime(60 * time.Second),
    		osLeakDetectionOption,
    	}
    )
    
    func osBranchFactory(key []byte) (objectstorage.StorableObject, int, error) {
    	return BranchFromStorageKey(key)
    }