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.MainContextorNone) – aGLib.MainContextfor processing Avahi events in, orNoneto use the current thread-default- Returns:
a new
OSTree.RepoFinderAvahi- Return type:
Create a new
OSTree.RepoFinderAvahiinstance. 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.RepoFinderAvahiis running (afterOSTree.RepoFinderAvahi.start() is called). This may be done from any thread.If context is
None, the current thread-defaultGLib.MainContextis 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.MainContextpassed to self at construction time must be iterated (so it will typically be the globalGLib.MainContext, or be a separateGLib.MainContextin 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.RepoFinderAvahiinstance 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.RepoFinderAvahiinstance, 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.RepoFinderAvahiinstance, or to call it beforeOSTree.RepoFinderAvahi.start().New in version 2018.6.