1. 04 Oct, 2019 2 commits
    • Kirill Smelkov's avatar
      time: Move code to pyx · 32f34607
      Kirill Smelkov authored
      In preparation to start migrating, at least partly, time functionality
      to nogil mode, move the code from time.py to _time.pyx . This is straight
      code movement except
      
      	now	-> pynow, and
      	sleep	-> pysleep
      
      replaces, since in _time.pyx now and sleep were already referring to
      nogil versions.
      
      We don't move just to time.pyx (note no _ prefix), since we will need to
      continue distinguishing pyx/nogil from py objects/functions, e.g.
      pyx time.second is C constant, while pyx time.pysecond is pyobject
      exported to python world as time.second.
      32f34607
    • Kirill Smelkov's avatar
      *: threading.Lock -> sync.Mutex · 548f2df1
      Kirill Smelkov authored
      Similarly to 78d85cdc (sync: threading.Event -> chan) replace everywhere
      threaing.Lock usage with sync.Mutex . This brings 2 goods:
      
      - sync.Mutex becomes more well tested;
      - we untie ourselves from threading python module (threading.Lock was
        the last user).
      548f2df1
  2. 29 Aug, 2019 1 commit
    • Kirill Smelkov's avatar
      pyx api: Provide sleep · ce8152a2
      Kirill Smelkov authored
      - Add sleep functionality to libgolang runtime;
      - Implement sleep for thread and gevent runtimes. Thread runtime
        implements sleep independently of GIL, but only for POSIX for now;
      - Switch golang.time py module into using golang.time pyx module.
      
      As we are adding sleep, related functionality to query system about
      "what is current time?" is also added.
      ce8152a2
  3. 16 May, 2019 1 commit
    • Kirill Smelkov's avatar
      time: New package that mirrors Go's time · 9c260fde
      Kirill Smelkov authored
      Add time.Timer, time.Ticker and convenience functions time.tick,
      time.after and time.after_func. These will be used in context to support
      deadlines and timeouts.
      
      While at time topic, also provide sleep and now from golang.time, so
      that there is no need to import both golang.time and stdlib's time in a
      file.
      
      Provide time constants in the module as they are useful to have and
      mirror constants provided by Go's time.
      
      Note: timers implementation is very suboptimal for now.
      9c260fde