1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-14 01:29:17 -04:00

injectable clock

This commit is contained in:
Darien Raymond
2018-01-23 23:12:02 +01:00
parent c3dce11c4e
commit 9cd0e90e99
2 changed files with 65 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ type Instance struct {
router syncRouter
ihm syncInboundHandlerManager
ohm syncOutboundHandlerManager
clock syncClock
features []Feature
id uuid.UUID
@@ -163,3 +164,8 @@ func (s *Instance) InboundHandlerManager() InboundHandlerManager {
func (s *Instance) OutboundHandlerManager() OutboundHandlerManager {
return &(s.ohm)
}
// Clock returns the Clock used by this Instance. The returned Clock is always functional.
func (s *Instance) Clock() Clock {
return &(s.clock)
}