Not directly related to this change, but I think conceptually a Span should always have a transaction? Because a Transaction always has itself as the transaction, and it'll pass down to all Span that are created by it and their descendants.
If that's the case, do you think we should mark transaction as a required constructor param? Like
class Span
def initialize(transaction:, ...)
end
end
class Transaction < Span
def initialize(transaction: nil, ...)
@transaction = self # ignore the passed argument
end
end
And then we can change attr_accessor :transaction to attr_reader + being sure the transaction will never be nil in such occasions.
Originally posted by @st0012 in #1869 (comment)
Not directly related to this change, but I think conceptually a
Spanshould always have atransaction? Because aTransactionalways has itself as thetransaction, and it'll pass down to allSpanthat are created by it and their descendants.If that's the case, do you think we should mark
transactionas a required constructor param? LikeAnd then we can change
attr_accessor :transactiontoattr_reader+ being sure thetransactionwill never benilin such occasions.Originally posted by @st0012 in #1869 (comment)