Documentation ¶
Index ¶
- Constants
- func NewRedis() (*redis.Client, error)
- type Manager
- func (m *Manager) AddBatchToQueue(blocks []int64) error
- func (m *Manager) AddTaskToQueue(block int64) error
- func (m *Manager) CheckTokenExists(addr string) bool
- func (m *Manager) Close() error
- func (m *Manager) GetTokenByAddress(addr string) *types.Token
- func (m *Manager) IsMonitoredAccount(addr string) bool
- func (m *Manager) IsMonitoredERC20(addr string) bool
- func (m *Manager) LockBlock(blockNumber int64) (bool, error)
- func (m *Manager) NextTask(ctx context.Context) (int64, error)
- func (m *Manager) RedisLock(key string) (bool, error)
- func (m *Manager) RedisUnlock(key string) error
- func (m *Manager) RefreshCache(ctx context.Context) error
- func (m *Manager) Reset() error
- func (m *Manager) StoreToken(ctx context.Context, token types.Token) error
- func (m *Manager) UnlockBlock(blockNumber int64) error
Constants ¶
View Source
const JuniorAPYAvgRefreshInterval = 30 * time.Minute
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct { Tokens map[string]types.Token SmartExposure *smartexposure.SmartExposure SmartYield *smartyield.SmartYield SmartAlpha *smartalpha.SmartAlpha // contains filtered or unexported fields }
func NewManager ¶
NewManager instantiates a new task manager and also takes care of the redis connection management it subscribes to the best block tracker for new blocks which it'll add to the redis queue automatically
func (*Manager) AddBatchToQueue ¶
func (*Manager) AddTaskToQueue ¶
AddTaskToQueue inserts a block into the redis sorted set used for queue management using a ZADD command
func (*Manager) CheckTokenExists ¶
func (*Manager) IsMonitoredAccount ¶
func (*Manager) IsMonitoredERC20 ¶
func (*Manager) RedisUnlock ¶
func (*Manager) StoreToken ¶
func (*Manager) UnlockBlock ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.