bugout-dev / humbug

Get usage metrics and crash reports for your API, library, or command line tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create library method that wraps `HumbugReporter.Publish` in a goroutine

zomglings opened this issue · comments

The function should have a signature like this:

func (reporter *HumbugReporter) PublishAsync(report Report) (func, <-bool) {
    ...
}

The return values should be:

  1. A function with no arguments and no return which can be run as a goroutine. when run, this routine will publish the given report.
  2. A channel to which the go routine will write true when publication is complete.

Instead of making this a method on HumbugReporter, we could also implement it with signature:

func PublishAsync(reporter *HumbugReporter, report Report) (func, <-bool) {
    ...
}