Skip to content

How do you wait for events as shown in the docs? #5

@purpleidea

Description

@purpleidea

How do you wait for events as shown in the docs? I can't see anything that take a context, so I'm assuming it's missing or built incorrectly? Eg from the FAQ:

How can I monitor changes or subscribe to signals?
Varlink connections can be turned into monitor connections, they are soft-negotiated between the client and the service. The client asks the server to possibly reply with more than one reply, the server replies and indicates that it might have more replies and the client should wait for them.

How do I do this in golang?

Additionally, you might want to change this type of interface:

https://godoc.org/github.com/varlink/go/varlink#Connection.Call

func (c *Connection) Call(method string, parameters interface{}, out_parameters interface{}) error

To something that takes a number of functions that return a param. Eg:

func (c *Connection) Call(method string, in []Param, out []Param) error

func BoolParam(value bool) Param
func IntParam(value bool) Param
func WhateverParam(value bool) Param

HTH

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions