XRootD
Loading...
Searching...
No Matches
XrdCl::TickGeneratorTask Class Reference
+ Inheritance diagram for XrdCl::TickGeneratorTask:
+ Collaboration diagram for XrdCl::TickGeneratorTask:

Public Member Functions

 TickGeneratorTask (XrdCl::Channel *channel, const std::string &hostId)
 
void Invalidate ()
 
time_t Run (time_t now)
 
- Public Member Functions inherited from XrdCl::Task
virtual ~Task ()
 
const std::string & GetName () const
 Name of the task.
 
void SetName (const std::string &name)
 Set name of the task.
 

Detailed Description

Definition at line 39 of file XrdClChannel.cc.

Constructor & Destructor Documentation

◆ TickGeneratorTask()

XrdCl::TickGeneratorTask::TickGeneratorTask ( XrdCl::Channel * channel,
const std::string & hostId )
inline

Definition at line 45 of file XrdClChannel.cc.

45 :
46 pChannel( channel )
47 {
48 std::string name = "TickGeneratorTask for: ";
49 name += hostId;
50 SetName( name );
51 }
void SetName(const std::string &name)
Set name of the task.

References XrdCl::Task::SetName().

+ Here is the call graph for this function:

Member Function Documentation

◆ Invalidate()

void XrdCl::TickGeneratorTask::Invalidate ( )
inline

Definition at line 70 of file XrdClChannel.cc.

71 {
72 XrdSysMutexHelper lck( pMtx );
73 pChannel = 0;
74 }

◆ Run()

time_t XrdCl::TickGeneratorTask::Run ( time_t now)
inlinevirtual

Perform the task

Parameters
nowcurrent timestamp
Returns
0 if the task is completed and should no longer be run or the time at which it should be run again

Implements XrdCl::Task.

Definition at line 56 of file XrdClChannel.cc.

57 {
58 XrdSysMutexHelper lck( pMtx );
59 if( !pChannel ) return 0;
60
61 using namespace XrdCl;
62 pChannel->Tick( now );
63
64 Env *env = DefaultEnv::GetEnv();
65 int timeoutResolution = DefaultTimeoutResolution;
66 env->GetInt( "TimeoutResolution", timeoutResolution );
67 return now+timeoutResolution;
68 }
static Env * GetEnv()
Get default client environment.
bool GetInt(const std::string &key, int &value)
Definition XrdClEnv.cc:89
const int DefaultTimeoutResolution

References XrdCl::DefaultTimeoutResolution, XrdCl::DefaultEnv::GetEnv(), and XrdCl::Env::GetInt().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: