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.
13
13
14
14
import IServerJobs from "../../../interfaces/Server/IServerJobs" ;
15
15
import HTTPServer from "./HTTPServer" ;
16
- import { Logger } from "../../../logger/Logger" ;
17
16
import { TypeDaprJobsCallback } from "../../../types/DaprJobsCallback.type" ;
18
17
19
18
export default class HTTPServerJobs implements IServerJobs {
20
19
21
- private readonly httpServer : HTTPServer ;
22
- private readonly logger : Logger ;
20
+ constructor ( private readonly httpServer : HTTPServer ) { }
23
21
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 {
30
24
this . httpServer . getServer ( ) . post ( `/job/${ jobName } ` , callback ) ;
31
25
}
32
26
}
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ See the License for the specific language governing permissions and
11
11
limitations under the License.
12
12
*/
13
13
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