<commit_before>functor
import
   VS           at 'x-oz://boot/VirtualSite'
   Timer(delay) at 'x-oz://system/Timer'
   Event(put)
%   System(showError:MSG)
define

   %% garbage collection of message chunks

   proc {GarbageCollect}
      {Timer.delay 60000}
%      {MSG '[VS] garbage collection'}
      {VS.processGC _}
      {GarbageCollect}
   end
   thread
      {Thread.setThisPriority low}
      {GarbageCollect}
   end

   %% probing of known virtual sites

   proc {Probes}
      {Timer.delay 1000}
%      {MSG '[VS] probes'}
      {VS.processProbes _}
      {Probes}
   end
   thread
      {Thread.setThisPriority low}
      {Probes}
   end

   %% processing the mailbox

   SIGUSR2 = {NewCell _}
   proc {USR2Handler _}
%      {MSG '[VS] SIGUSR2'}
      {Exchange SIGUSR2 unit _}
   end
   {Event.put 'SIGUSR2' USR2Handler}
   thread
      This = {Thread.this}
      {Thread.setPriority This high}
      proc {Mailbox}
         Again = {Access SIGUSR2}
      in
%        {MSG '[VS] mailbox'}
         if {VS.processMailbox} then
            {Thread.preempt This}
         else
            {Wait Again}
         end
         {Mailbox}
      end
   in
      {Mailbox}
   end

   %% processing the message queue

   VSMsgQ = {NewCell _}
   proc {VSMsgQHandler _}
%      {MSG '[VS] VSMsgQ'}
      {Exchange VSMsgQ unit _}
   end
   {Event.put 'VSMsgQ' VSMsgQHandler}
   thread
      This = {Thread.this}
      {Thread.setPriority This high}
      proc {MessageQ}
         Again = {Access VSMsgQ}
      in
%        {MSG '[VS] message Q'}
         if {VS.processMessageQ} then
            {Thread.preempt This}
         else
            {Wait Again}
         end
         {MessageQ}
      end
   in
      {MessageQ}
   end
end<commit_msg>processing support for virtual sites:<commit_after>functor
import
   VS           at 'x-oz://boot/VirtualSite'
   Timer(delay) at 'x-oz://system/Timer'
   Event(put)
define

   %% garbage collection of message chunks

   proc {GarbageCollect}
      {Timer.delay 60000}
      {VS.processGC _}
      {GarbageCollect}
   end
   thread
      {Thread.setThisPriority low}
      {GarbageCollect}
   end

   %% probing of known virtual sites

   proc {Probes}
      {Timer.delay 1000}
      {VS.processProbes _}
      {Probes}
   end
   thread
      {Thread.setThisPriority low}
      {Probes}
   end

   %% processing the mailbox

   SIGUSR2 = {NewCell _}
   proc {USR2Handler _}
      {Exchange SIGUSR2 unit _}
   end
   {Event.put 'SIGUSR2' USR2Handler}
   thread
      This = {Thread.this}
      {Thread.setPriority This high}
      proc {Mailbox}
         Again = {Access SIGUSR2}
      in
         if {VS.processMailbox} then
            {Thread.preempt This}
%           skip
         else
            {Wait Again}
         end
         {Mailbox}
      end
   in
      {Mailbox}
   end

   %% processing the message queue

   VSMsgQ = {NewCell _}
   proc {VSMsgQHandler _}
      {Exchange VSMsgQ unit _}
   end
   {Event.put 'VSMsgQ' VSMsgQHandler}
   thread
      This = {Thread.this}
      {Thread.setPriority This high}
      proc {MessageQ}
         Again = {Access VSMsgQ}
      in
         if {VS.processMessageQ} then
            {Thread.preempt This}
%           skip
         else
            {Wait Again}
         end
         {MessageQ}
      end
   in
      {MessageQ}
   end
end
{'fraction_non_alphanumeric': 0.0933093309330933, 'fraction_numerical': 0.0093009300930093, 'mean_word_length': 1.7760199833472106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4008431', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1088, 'n_words': 278}