You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2020/12/08 21:22:00 UTC
[jira] [Resolved] (THRIFT-5295) Thread and ThreadFactory should be
extensible
[ https://issues.apache.org/jira/browse/THRIFT-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jens Geyer resolved THRIFT-5295.
--------------------------------
Assignee: R.Ghetta
Resolution: Fixed
> Thread and ThreadFactory should be extensible
> ---------------------------------------------
>
> Key: THRIFT-5295
> URL: https://issues.apache.org/jira/browse/THRIFT-5295
> Project: Thrift
> Issue Type: Improvement
> Components: C++ - Library
> Affects Versions: 0.13.0
> Reporter: R.Ghetta
> Assignee: R.Ghetta
> Priority: Minor
> Fix For: 0.14.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Thread and ThreadFactory are both declared final, making impossible to extend them without duplicating or reimplementing much code.
> As an example, to customize thread startup with TNonblockingServer, you need to copy or reimplement not only ThreadFactory and Thread, but also Task, Runnable and TNonblockingServer.
> TNonblockingServer always creates Task instances, and Task descends from Runnable, containing a Thread pointer.
> Removing final and making some methods virtual will allow everyone to customize Thread without resorting to code duplication.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)