File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * The Dart Frog daemon is a long-running process that is responsible for
3
+ * managing a single or multiple Dart Frog projects simultaneously.
4
+ *
5
+ * @see {@link https://dartfrog.vgv.dev/docs/advanced/daemon Dart Frog deamon documentation }
6
+ */
7
+ export class DartFrogDaemon {
8
+ private static _instance : DartFrogDaemon ;
9
+
10
+ /**
11
+ * A singleton instance of the Dart Frog daemon.
12
+ *
13
+ * A Dart Frog daemon can manage multiple Dart Frog projects simultaneously.
14
+ */
15
+ public static get instance ( ) {
16
+ return this . _instance || ( this . _instance = new this ( ) ) ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ export * from "./dart-frog-daemon" ;
Original file line number Diff line number Diff line change
1
+ import assert = require( "assert" ) ;
2
+ import { DartFrogDaemon } from "../../../daemon" ;
3
+
4
+ suite ( "DartFrogDaemon" , ( ) => {
5
+ test ( "instance retrieves a singleton" , ( ) => {
6
+ const dartFrogDaemon = DartFrogDaemon . instance ;
7
+ const dartFrogDaemon2 = DartFrogDaemon . instance ;
8
+
9
+ assert . equal ( dartFrogDaemon , dartFrogDaemon2 ) ;
10
+ } ) ;
11
+ } ) ;
You can’t perform that action at this time.
0 commit comments