OSTree.RepoFinderAvahi¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class OSTree.RepoFinderAvahi(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(context)¶
- Parameters:
context (
GLib.MainContext
orNone
) – aGLib.MainContext
for processing Avahi events in, orNone
to use the current thread-default- Returns:
a new
OSTree.RepoFinderAvahi
- Return type:
Create a new
OSTree.RepoFinderAvahi
instance. It is intended that one such instance be created per process, and it be used to answer all resolution requests fromOSTree.Repos
.The calling code is responsible for ensuring that context is iterated while the
OSTree.RepoFinderAvahi
is running (afterOSTree.RepoFinderAvahi.start
() is called). This may be done from any thread.If context is
None
, the current thread-defaultGLib.MainContext
is used.New in version 2018.6.
- start()¶
- Raises:
Start monitoring the local network for peers who are advertising OSTree repositories, using Avahi. In order for this to work, the
GLib.MainContext
passed to self at construction time must be iterated (so it will typically be the globalGLib.MainContext
, or be a separateGLib.MainContext
in a worker thread).This will return an error (
Gio.IOErrorEnum.FAILED
) if initialisation fails, or if Avahi support is not available (Gio.IOErrorEnum.NOT_SUPPORTED
). In either case, theOSTree.RepoFinderAvahi
instance is useless afterwards and should be destroyed.Call
OSTree.RepoFinderAvahi.stop
() to stop the repo finder.It is an error to call this function multiple times on the same
OSTree.RepoFinderAvahi
instance, or to call it afterOSTree.RepoFinderAvahi.stop
().New in version 2018.6.
- stop()¶
Stop monitoring the local network for peers who are advertising OSTree repositories. If any resolve tasks (from
OSTree.RepoFinder.resolve_async
()) are in progress, they will be cancelled and will returnGio.IOErrorEnum.CANCELLED
.Call
OSTree.RepoFinderAvahi.start
() to start the repo finder.It is an error to call this function multiple times on the same
OSTree.RepoFinderAvahi
instance, or to call it beforeOSTree.RepoFinderAvahi.start
().New in version 2018.6.