discontinuedPackage is_journal has been discontinued and replaced by is_logbook.

start static method

Future<JournalService> start(
  1. Journal journal,
  2. SenderTable senders,
  3. File socket, {
  4. File? readSocket,
})

Starts writing journal for the senders in senders, listening on socket, and for readers on readSocket when it is given. Reads the chains back from the journal, then adds the started entry. Throws a StateError when another service is listening on either socket; a socket file nothing listens on is replaced.

Implementation

static Future<JournalService> start(
  Journal journal,
  SenderTable senders,
  File socket, {
  File? readSocket,
}) async {
  final service = JournalService._(
    journal,
    senders,
    socket,
    await _bind(socket),
  );
  if (readSocket != null) {
    service._readServer = await _bind(readSocket);
    service._readSocket = readSocket;
    service._readServer!.listen(service._serveReader);
  }
  service
    .._load()
    .._append(Kind.started, null, senders.bytes);
  service._server.listen(service._serve);
  return service;
}