Skip to content

Why not use Response.Dispose? #9803

@jerviscui

Description

@jerviscui

Response<TResult> is created by ResponsePool, and returns to the pool with the Dispose() method.

Why wasn't Dispose() called in SafeSendResponse?

private void SafeSendResponse(Message message, Response response)
{
    try
    {
        SendResponse(message, (Response)this._deepCopier.Copy(response));
    }
    catch (Exception exc)
    {
        LogWarningResponseFailed(this.logger, exc);
        SendResponse(message, Response.FromException(exc));
    }

    //perhaps finally
    final{
      response.Dispose();
    }
}
```Dispose

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions