Opened 3 years ago

Last modified 3 years ago

#3522 new defect

Gerrit Reporter summaryCB does not accept deferreds

Reported by: ryansydnor Owned by:
Priority: minor Milestone: undecided
Version: master Keywords:
Cc:

Description

I am trying to pull extra information about a particular build (steps, in this case). I am not able to yield getDetailsForBuild(master, build, wantSteps=True) because I cannot make my callback a @defer.inlineCallbacks.

I see a couple of solutions:

  1. Make sendBuildSetSummary a @defer.inlineCallbacks and yield the call to self.summaryCB, which would break backwards compatibility
  2. Take a new "summaryCBDeferred" in the constructor. Do the same as above, if specified. This would retain backwards compatibility
  3. Take "wantSteps", "wantLogs", "wantX" into the constructor, pass those through to the "buildsetComplete" call to "getDetailsForBuildset" so the consumer is none the wiser. This will retain backwards compatibility.

Change History (2)

comment:1 Changed 3 years ago by tardyp

yield the call to self.summaryCB will not break compatibility.

yield will also work if the function does not return a deferred. So solution 1 is the way to go!

Note: See TracTickets for help on using tickets.