Documentation ¶
Index ¶
- func Close() error
- func Init(serverAddr []string) error
- func PublishShardUpdate(shardID uint32, blkNum uint64, logs []*types.Log) error
- func PublishTxPoolUpdate(shardID uint32, tx types.PoolTransaction, local bool) error
- func SubscribeShardUpdate(shardID uint32, cb func(blkNum uint64, logs []*types.Log))
- func SubscribeTxPoolUpdate(shardID uint32, cb func(tx types.PoolTransaction, local bool))
- type BlockUpdate
- type LockResult
- type RedisPreempt
- type TxPoolUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PublishShardUpdate ¶
PublishShardUpdate publish block update event
func PublishTxPoolUpdate ¶
func PublishTxPoolUpdate(shardID uint32, tx types.PoolTransaction, local bool) error
PublishTxPoolUpdate publish tx pool update event
func SubscribeShardUpdate ¶
SubscribeShardUpdate subscribe block update event
func SubscribeTxPoolUpdate ¶
func SubscribeTxPoolUpdate(shardID uint32, cb func(tx types.PoolTransaction, local bool))
SubscribeTxPoolUpdate subscribe tx pool update event
Types ¶
type BlockUpdate ¶
BlockUpdate block update event
type LockResult ¶ added in v0.1.14
type LockResult int
const ( LockResultSuccess LockResult LockResultRenewalSuccess LockResultFail )
type RedisPreempt ¶
type RedisPreempt struct {
// contains filtered or unexported fields
}
func CreatePreempt ¶
func CreatePreempt(key string) *RedisPreempt
CreatePreempt used to create a redis preempt instance
func (*RedisPreempt) LastLockStatus ¶
func (p *RedisPreempt) LastLockStatus() bool
LastLockStatus get the last preempt status
func (*RedisPreempt) TryLock ¶
func (p *RedisPreempt) TryLock(ttlSecond int) (result LockResult, err error)
TryLock attempt to lock the master for ttlSecond
func (*RedisPreempt) Unlock ¶
func (p *RedisPreempt) Unlock() (bool, error)
Unlock try to release the master permission
type TxPoolUpdate ¶
type TxPoolUpdate struct { Local bool Tx types.PoolTransaction // contains filtered or unexported fields }
TxPoolUpdate tx pool update event
Click to show internal directories.
Click to hide internal directories.