File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
implementation/Server/HTTPServer Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,14 @@ limitations under the License.
1313
1414import IServerJobs from "../../../interfaces/Server/IServerJobs" ;
1515import HTTPServer from "./HTTPServer" ;
16- import { Logger } from "../../../logger/Logger" ;
1716import { TypeDaprJobsCallback } from "../../../types/DaprJobsCallback.type" ;
1817
1918export default class HTTPServerJobs implements IServerJobs {
2019
21- private readonly httpServer : HTTPServer ;
22- private readonly logger : Logger ;
20+ constructor ( private readonly httpServer : HTTPServer ) { }
2321
24- constructor ( httpServer : HTTPServer ) {
25- this . logger = new Logger ( "HTTPServer" , "Jobs" , httpServer . client . options . logger ) ;
26- this . httpServer = httpServer ;
27- }
28-
29- listen ( jobName : string , callback : TypeDaprJobsCallback ) : void {
22+ listen ( jobName : string , callback : TypeDaprJobsCallback ) : void ;
23+ listen < DataType > ( jobName : string , callback : TypeDaprJobsCallback < DataType > ) : void {
3024 this . httpServer . getServer ( ) . post ( `/job/${ jobName } ` , callback ) ;
3125 }
3226}
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ See the License for the specific language governing permissions and
1111limitations under the License.
1212*/
1313
14- export type TypeDaprJobsCallback = ( data : any , headers : object ) => Promise < any | void > ;
14+ export type TypeDaprJobsCallback < DataType = object | string > = ( data : DataType , headers : object ) => Promise < unknown > ;
You can’t perform that action at this time.
0 commit comments