MCPcopy
hub / github.com/grafana/dskit / Send

Method Send

services/example_test.go:36–49  ·  view source on GitHub ↗

External method called by clients of the Service.

(msg string)

Source from the content-addressed store, hash-verified

34
35// External method called by clients of the Service.
36func (s *exampleService) Send(msg string) bool {
37 ctx := s.ServiceContext()
38 if ctx == nil {
39 // Service is not yet started
40 return false
41 }
42 select {
43 case s.ch <- msg:
44 return true
45 case <-ctx.Done():
46 // Service is not running anymore.
47 return false
48 }
49}
50
51func ExampleService() {
52 es := newExampleServ()

Callers

nothing calls this directly

Calls 2

ServiceContextMethod · 0.80
DoneMethod · 0.65

Tested by

no test coverage detected