engine: resources: Add fragments support to file resource

This adds a "fragments" mode to the file resource. In addition to
"content" and "source", you can now alternatively build a file from the
file fragments of other files.
This commit is contained in:
James Shubin
2019-10-22 12:17:17 -04:00
parent b961c96862
commit 58421fd31a
7 changed files with 445 additions and 30 deletions

View File

@@ -96,6 +96,7 @@ func (obj *RecWatcher) Init() error {
obj.mutex.Lock()
if !obj.closed {
select {
// TODO: &Event instead?
case obj.events <- Event{Error: err}:
case <-obj.exit:
// pass
@@ -282,6 +283,7 @@ func (obj *RecWatcher) Watch() error {
// only invalid state on certain types of events
select {
// exit even when we're blocked on event sending
// TODO: &Event instead?
case obj.events <- Event{Error: nil, Body: &event}:
case <-obj.exit:
return fmt.Errorf("pending event not sent")