Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread NCrashed via Digitalmars-d-announce
Finally I've finished library for wrapping applications into daemons or services (Windows). The library hides platform-specific boilerplate behind compile-time API: ``` // First you need to describe your daemon via template alias daemon = Daemon!( DaemonizeExample1, // unique name //

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread ketmar via Digitalmars-d-announce
On Sun, 31 Aug 2014 11:27:41 + NCrashed via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: looks very interesting, thank you. signature.asc Description: PGP signature

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-announce
Nice! I have a few questions/remarks, mainly to simplify the API somewhat. Please bear with me :-) // First you need to describe your daemon via template alias daemon = Daemon!( DaemonizeExample1, // unique name Does the user sees/uses this name in any way afterwards? Because I think you

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread NCrashed via Digitalmars-d-announce
Thanks a lot for the respond! Does the user sees/uses this name in any way afterwards? Because I think you could also produce a unique string at compile-time (by using __FILE__ and __LINE__, unless someone has a better idea), if the user does not provide one. Maybe he just wants an anonymous

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-announce
Does the user sees/uses this name in any way afterwards? Because I think you could also produce a unique string at compile-time (by using __FILE__ and __LINE__, unless someone has a better idea), if the user does not provide one. Maybe he just wants an anonymous daemon, or doesn't care,

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread NCrashed via Digitalmars-d-announce
IIRC, I read in your code that composed signals means the next delegate must have the (logger, signal) {...} form. Why? I can (not must) have the form, the delegate params are tested independently from signal composition. Is that the standard behavior for daemons in OSes? Most signals are

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread Meta via Digitalmars-d-announce
On Sunday, 31 August 2014 at 16:01:10 UTC, Philippe Sigaud via Digitalmars-d-announce wrote: * Custom signals enum Signal : string { ... } @nogc Signal customSignal(string name) @safe pure nothrow { return cast(Signal)name; } I didn't know you could have an enum and extend it with a cast

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-announce
On Sun, Aug 31, 2014 at 11:36 PM, Meta via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: I didn't know you could have an enum and extend it with a cast like this. This is not a good thing. Enums are supposed to denote a *closed*, enumerated set of items. I agree. It's

Re: Daemonize v0.1 - simple way to create cross-platform daemons

2014-08-31 Thread Philippe Sigaud via Digitalmars-d-announce
I can (not must) have the form, the delegate params are tested independently from signal composition. OK, good. Is that the standard behavior for daemons in OSes? Most signals are simply ignored (except termination ones). I see. Some signals could be sent without any reason: sighup or