Package ecore :: Module c_ecore :: Class FdHandler
[hide private]
[frames] | no frames]

Class FdHandler

object --+
         |
        FdHandler

Adds a callback for activity on the given file descriptor.

func will be called during the execution of main_loop_begin() when the file descriptor is available for reading, or writing, or both.

When the handler func is called, it must return a value of either True or False (remember that Python returns None if no value is explicitly returned and None evaluates to False). If it returns True, it will continue to montior the given file descriptor, or if it returns False it will be deleted automatically making any references/handles for it invalid.

FdHandler use includes:

func signature: func(fd_handler, *args, **kargs): bool

Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(...)
repr(x)
 
__str__(...)
str(x)
bool
active_get(...)
Return if read, write or error, or a combination thereof, is active on the file descriptor of the given FD handler.
 
active_set(...)
Set what active streams the given FdHandler should be monitoring.
bool
can_read(...)
bool
can_write(...)
 
delete(...)
Stop callback emission and free internal resources.
int
fd_get(...)
bool
has_error(...)
 
prepare_callback_set(...)
Set a function to call becore doing the select() on the fd.
 
stop(...)
Alias for delete().

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  fd

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(...)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(...)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

prepare_callback_set(...)

 

Set a function to call becore doing the select() on the fd.

Signature: function(object, *args, **kargs)